Skip to content

Commit

Permalink
Avoid cloning Place in visit_rvalue
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jul 20, 2019
1 parent 7789cbf commit b59ded8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/librustc_mir/transform/qualify_consts.rs
Expand Up @@ -1199,10 +1199,10 @@ impl<'a, 'tcx> Visitor<'tcx> for Checker<'a, 'tcx> {
MutatingUseContext::Borrow,
),
};
self.visit_place(&Place {
base: place.base.clone(),
projection: proj.clone(),
}, ctx, location);
self.visit_place_base(&place.base, ctx, location);
if let Some(proj) = proj {
self.visit_projection(&place.base, proj, ctx, location);
}
} else {
self.super_rvalue(rvalue, location);
}
Expand Down

0 comments on commit b59ded8

Please sign in to comment.