Avoid cloning Place in assign #2

This commit is contained in:
Santiago Pastorino 2019-07-19 22:49:17 +02:00
parent b490032893
commit 7789cbf700

View file

@ -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;
}
}