Skip to content

Commit 3db2f6d

Browse files
committed
clearer reasoning
1 parent b7c19b0 commit 3db2f6d

File tree

1 file changed

+2
-3
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+2
-3
lines changed

compiler/rustc_mir_transform/src/gvn.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -418,9 +418,7 @@ impl<'body, 'tcx> VnState<'body, 'tcx> {
418418
ecx.copy_op(op, &field_dest)?;
419419
}
420420

421-
let dest = dest.assert_mem_place();
422-
//ecx.alloc_mark_immutable(dest.ptr().provenance.unwrap().alloc_id()).unwrap();
423-
let dest = dest.map_provenance(|prov| prov.as_immutable());
421+
let dest = dest.assert_mem_place().map_provenance(|prov| prov.as_immutable());
424422
mplace.replace(dest);
425423
Ok(())
426424
}).ok()?;
@@ -1388,6 +1386,7 @@ impl<'tcx> MutVisitor<'tcx> for VnState<'_, 'tcx> {
13881386
.as_local()
13891387
.and_then(|local| self.locals[local])
13901388
.or_else(|| self.simplify_rvalue(rvalue, location));
1389+
debug!(?value);
13911390
let Some(value) = value else { return };
13921391

13931392
if let Some(const_) = self.try_as_constant(value) {

0 commit comments

Comments
 (0)