Skip to content

Commit 7789cbf

Browse files
committed
Avoid cloning Place in assign #2
1 parent b490032 commit 7789cbf

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/librustc_mir/transform/qualify_consts.rs

+2-8
Original file line numberDiff line numberDiff line change
@@ -877,14 +877,8 @@ impl<'a, 'tcx> Checker<'a, 'tcx> {
877877
(&PlaceBase::Static(box Static{ kind: _, .. }), None) => {
878878
// Catch more errors in the destination. `visit_place` also checks that we
879879
// do not try to access statics from constants or try to mutate statics
880-
self.visit_place(
881-
&Place {
882-
base: dest.base.clone(),
883-
projection: dest_projection.clone(),
884-
},
885-
PlaceContext::MutatingUse(MutatingUseContext::Store),
886-
location
887-
);
880+
let context = PlaceContext::MutatingUse(MutatingUseContext::Store);
881+
self.visit_place_base(&dest.base, context, location);
888882
return;
889883
}
890884
}

0 commit comments

Comments
 (0)