From 7789cbf700f5633b895ced21f7ffd2f33661542e Mon Sep 17 00:00:00 2001 From: Santiago Pastorino Date: Fri, 19 Jul 2019 22:49:17 +0200 Subject: [PATCH] Avoid cloning Place in assign #2 --- src/librustc_mir/transform/qualify_consts.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index da8304419bf23..a05ac89921de9 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -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; } }