Skip to content

Commit

Permalink
Avoid cloning Place in assign #1
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jul 20, 2019
1 parent 2a7d600 commit b490032
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions src/librustc_mir/transform/qualify_consts.rs
Expand Up @@ -865,14 +865,9 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
(base, Some(proj)) => {
// Catch more errors in the destination. `visit_place` also checks various
// projection rules like union field access and raw pointer deref
self.visit_place(
&Place {
base: base.clone(),
projection: dest_projection.clone(),
},
PlaceContext::MutatingUse(MutatingUseContext::Store),
location
);
let context = PlaceContext::MutatingUse(MutatingUseContext::Store);
self.visit_place_base(base, context, location);
self.visit_projection(base, proj, context, location);
dest_projection = &proj.base;
},
(&PlaceBase::Static(box Static {
Expand Down

0 comments on commit b490032

Please sign in to comment.