Avoid cloning Place in assign #1

This commit is contained in:
Santiago Pastorino 2019-07-19 22:41:52 +02:00
parent 2a7d600ee0
commit b490032893

View File

@ -865,14 +865,9 @@ fn assign(&mut self, dest: &Place<'tcx>, source: ValueSource<'_, 'tcx>, location
(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 {