qualify-const remove cannot mutate statics in initializer of another static error
This commit is contained in:
parent
9248b019b2
commit
b941034f2f
1 changed files with 0 additions and 13 deletions
|
|
@ -782,19 +782,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Checker<'a, 'tcx> {
|
|||
|
||||
// Only allow statics (not consts) to refer to other statics.
|
||||
if self.mode == Mode::Static || self.mode == Mode::StaticMut {
|
||||
if self.mode == Mode::Static
|
||||
&& context.is_mutating_use()
|
||||
&& !self.suppress_errors
|
||||
{
|
||||
// this is not strictly necessary as miri will also bail out
|
||||
// For interior mutability we can't really catch this statically as that
|
||||
// goes through raw pointers and intermediate temporaries, so miri has
|
||||
// to catch this anyway
|
||||
self.tcx.sess.span_err(
|
||||
self.span,
|
||||
"cannot mutate statics in the initializer of another static",
|
||||
);
|
||||
}
|
||||
return;
|
||||
}
|
||||
unleash_miri!(self);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue