Skip to content

Commit 07345f0

Browse files
committed
Undo a change that got lost in the larger refactorings
1 parent e6e08c6 commit 07345f0

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/librustc_mir/transform/qualify_consts.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -557,9 +557,11 @@ impl<'a, 'tcx> Visitor<'tcx> for Qualifier<'a, 'tcx, 'tcx> {
557557
match proj.elem {
558558
ProjectionElem::Deref => {
559559
if context.is_mutating_use() {
560+
// `not_const` errors out in const contexts
560561
this.not_const()
561562
} else {
562-
this.qualif = Qualif::NOT_CONST;
563+
// just make sure this doesn't get promoted
564+
this.qualif.add(Qualif::NOT_CONST);
563565
}
564566
let base_ty = proj.base.ty(this.mir, this.tcx).to_ty(this.tcx);
565567
match this.mode {

0 commit comments

Comments
 (0)