]> git.lizzy.rs Git - rust.git/commitdiff
Undo a change that got lost in the larger refactorings
authorOliver Scherer <github35764891676564198441@oli-obk.de>
Wed, 12 Dec 2018 08:34:43 +0000 (09:34 +0100)
committerOliver Scherer <github35764891676564198441@oli-obk.de>
Wed, 12 Dec 2018 08:34:43 +0000 (09:34 +0100)
src/librustc_mir/transform/qualify_consts.rs

index 0f54978c1dec673cb59affff0ea170d49e510112..2caeba6c06a3173918b328043d05e8bf421e972a 100644 (file)
@@ -557,9 +557,11 @@ fn visit_place(&mut self,
                     match proj.elem {
                         ProjectionElem::Deref => {
                             if context.is_mutating_use() {
+                                // `not_const` errors out in const contexts
                                 this.not_const()
                             } else {
-                                this.qualif = Qualif::NOT_CONST;
+                                // just make sure this doesn't get promoted
+                                this.qualif.add(Qualif::NOT_CONST);
                             }
                             let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
                             match this.mode {