about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2019-11-11 19:11:24 +0100
committerSantiago Pastorino <spastorino@gmail.com>2019-11-12 13:20:19 +0100
commitb941034f2f4ffe42e9b7eb19c9a726f9fdc6d35f (patch)
treeb754c2903628c4fbfbcc2e2bd3cc1b11248ce1f3
parent9248b019b22224b6d99cc504edd50bd9ed015d3f (diff)
downloadrust-b941034f2f4ffe42e9b7eb19c9a726f9fdc6d35f.tar.gz
rust-b941034f2f4ffe42e9b7eb19c9a726f9fdc6d35f.zip
qualify-const remove cannot mutate statics in initializer of another static error
-rw-r--r--src/librustc_mir/transform/qualify_consts.rs13
1 files changed, 0 insertions, 13 deletions
diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs
index 5ad5363768d..15d771ac685 100644
--- a/src/librustc_mir/transform/qualify_consts.rs
+++ b/src/librustc_mir/transform/qualify_consts.rs
@@ -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);