mirror of
https://github.com/rust-lang/rust.git
synced 2026-05-04 09:53:04 +03:00
Avoid cloning Place in assign #2
This commit is contained in:
@@ -877,14 +877,8 @@ fn assign(&mut self, dest: &Place<'tcx>, source: ValueSource<'_, 'tcx>, location
|
||||
(&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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user