diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2019-07-19 22:41:52 +0200 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2019-07-20 05:08:39 +0200 |
| commit | b49003289366411f7d5e0359af2c3de3b5b850e7 (patch) | |
| tree | 5eed95af51a9ef5b418355130ab03a038e00438e | |
| parent | 2a7d600ee0a8e5a56fc515beb7a066cc178c926e (diff) | |
| download | rust-b49003289366411f7d5e0359af2c3de3b5b850e7.tar.gz rust-b49003289366411f7d5e0359af2c3de3b5b850e7.zip | |
Avoid cloning Place in assign #1
| -rw-r--r-- | src/librustc_mir/transform/qualify_consts.rs | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/librustc_mir/transform/qualify_consts.rs b/src/librustc_mir/transform/qualify_consts.rs index eadda7b52a1..da8304419bf 100644 --- a/src/librustc_mir/transform/qualify_consts.rs +++ b/src/librustc_mir/transform/qualify_consts.rs @@ -865,14 +865,9 @@ impl<'a, 'tcx> Checker<'a, 'tcx> { (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 { |
