diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2019-07-19 22:49:17 +0200 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2019-07-20 05:08:39 +0200 |
| commit | 7789cbf700f5633b895ced21f7ffd2f33661542e (patch) | |
| tree | 8f90193fe10a81b2704081ff0b73c6fd399c4a2d | |
| parent | b49003289366411f7d5e0359af2c3de3b5b850e7 (diff) | |
| download | rust-7789cbf700f5633b895ced21f7ffd2f33661542e.tar.gz rust-7789cbf700f5633b895ced21f7ffd2f33661542e.zip | |
Avoid cloning Place in assign #2
| -rw-r--r-- | src/librustc_mir/transform/qualify_consts.rs | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index da8304419bf..a05ac89921d 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; } } |
