We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a5fd8d9 commit 8c2497bCopy full SHA for 8c2497b
compiler/rustc_mir_transform/src/gvn.rs
@@ -1373,6 +1373,10 @@ impl<'tcx> VnState<'_, 'tcx> {
1373
assert!(!value.may_have_provenance(self.tcx, op.layout.size));
1374
1375
let const_ = Const::Val(value, op.layout.ty);
1376
+ // cache the propagated const
1377
+ if let Some(new_index) = self.insert_constant(const_) {
1378
+ self.values.swap_indices(index.as_usize(), new_index.as_usize());
1379
+ }
1380
Some(ConstOperand { span: DUMMY_SP, user_ty: None, const_ })
1381
}
1382
0 commit comments