Skip to content

Commit

Permalink
Avoid cloning Place in assign #2
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Jul 20, 2019
1 parent b490032 commit 7789cbf
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/librustc_mir/transform/qualify_consts.rs
Expand Up @@ -877,14 +877,8 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
(&PlaceBase::Static(box Static{ kind: _, .. }), None) => {
// Catch more errors in the destination. `visit_place` also checks that we
// do not try to access statics from constants or try to mutate statics
self.visit_place(
&Place {
base: dest.base.clone(),
projection: dest_projection.clone(),
},
PlaceContext::MutatingUse(MutatingUseContext::Store),
location
);
let context = PlaceContext::MutatingUse(MutatingUseContext::Store);
self.visit_place_base(&dest.base, context, location);
return;
}
}
Expand Down

0 comments on commit 7789cbf

Please sign in to comment.