Skip to content

Commit b941034

Browse files
committed
qualify-const remove cannot mutate statics in initializer of another static error
1 parent 9248b01 commit b941034

File tree

1 file changed

+0
-13
lines changed

1 file changed

+0
-13
lines changed

src/librustc_mir/transform/qualify_consts.rs

-13
Original file line numberDiff line numberDiff line change
@@ -782,19 +782,6 @@ impl<'a, 'tcx> Visitor<'tcx> for Checker<'a, 'tcx> {
782782

783783
// Only allow statics (not consts) to refer to other statics.
784784
if self.mode == Mode::Static || self.mode == Mode::StaticMut {
785-
if self.mode == Mode::Static
786-
&& context.is_mutating_use()
787-
&& !self.suppress_errors
788-
{
789-
// this is not strictly necessary as miri will also bail out
790-
// For interior mutability we can't really catch this statically as that
791-
// goes through raw pointers and intermediate temporaries, so miri has
792-
// to catch this anyway
793-
self.tcx.sess.span_err(
794-
self.span,
795-
"cannot mutate statics in the initializer of another static",
796-
);
797-
}
798785
return;
799786
}
800787
unleash_miri!(self);

0 commit comments

Comments
 (0)