1
Fork 0

Comment move->copy transform.

This commit is contained in:
Camille Gillot 2023-02-06 18:14:24 +01:00 committed by GitHub
parent 5c1cb5bbc6
commit 9c5add14e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -153,6 +153,7 @@ impl<'tcx> MutVisitor<'tcx> for Replacer<'_, 'tcx> {
fn visit_operand(&mut self, operand: &mut Operand<'tcx>, loc: Location) {
if let Operand::Move(place) = *operand
// A move out of a projection of a copy is equivalent to a copy of the original projection.
&& !place.has_deref()
&& !self.fully_moved.contains(place.local)
{