Skip to content

Commit 9c5add1

Browse files
authored
Comment move->copy transform.
1 parent 5c1cb5b commit 9c5add1

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

compiler/rustc_mir_transform/src/copy_prop.rs

+1
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ impl<'tcx> MutVisitor<'tcx> for Replacer<'_, 'tcx> {
153153

154154
fn visit_operand(&mut self, operand: &mut Operand<'tcx>, loc: Location) {
155155
if let Operand::Move(place) = *operand
156+
// A move out of a projection of a copy is equivalent to a copy of the original projection.
156157
&& !place.has_deref()
157158
&& !self.fully_moved.contains(place.local)
158159
{

0 commit comments

Comments
 (0)