Skip to content

Commit 4bfb701

Browse files
committed
fix Rvalue::Use usage
1 parent 06b7ccd commit 4bfb701

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

  • compiler/rustc_mir_transform/src

compiler/rustc_mir_transform/src/gvn.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,9 +1075,11 @@ impl<'body, 'a, 'tcx> VnState<'body, 'a, 'tcx> {
10751075
}
10761076
Rvalue::Reborrow(_, mutbl, place) => {
10771077
if mutbl == Mutability::Mut {
1078+
// Note: this is adapted from simplify_aggregate.
10781079
let mut operand = Operand::Copy(place);
10791080
let val = self.simplify_operand(&mut operand, location);
1080-
*rvalue = Rvalue::Use(operand);
1081+
// FIXME(reborrow): Is it correct to make these retagging assignments?
1082+
*rvalue = Rvalue::Use(Operand::Copy(place), WithRetag::Yes);
10811083
return val;
10821084
} else {
10831085
// FIXME(reborrow): CoerceShared should perform effectively a copy followed by a

0 commit comments

Comments
 (0)