diff options
| author | Camelid <camelidcamel@gmail.com> | 2020-11-15 12:58:34 -0800 |
|---|---|---|
| committer | Camelid <camelidcamel@gmail.com> | 2020-11-15 12:58:34 -0800 |
| commit | f7bf282d9be6a0917f950e83f1856e1c5ede1a33 (patch) | |
| tree | 80590c2b05b74f37e31e401a1755689dfb80714b | |
| parent | 603ab5bd6e0ffefafa7411cd8bd23a6ca82bcff0 (diff) | |
| download | rust-f7bf282d9be6a0917f950e83f1856e1c5ede1a33.tar.gz rust-f7bf282d9be6a0917f950e83f1856e1c5ede1a33.zip | |
MIR visitor: Don't treat debuginfo field access as a use of the struct
| -rw-r--r-- | compiler/rustc_middle/src/mir/visit.rs | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/compiler/rustc_middle/src/mir/visit.rs b/compiler/rustc_middle/src/mir/visit.rs index d8d639ab734..e9a27c82af2 100644 --- a/compiler/rustc_middle/src/mir/visit.rs +++ b/compiler/rustc_middle/src/mir/visit.rs @@ -1017,11 +1017,13 @@ macro_rules! visit_place_fns { let mut context = context; if !place.projection.is_empty() { - context = if context.is_mutating_use() { - PlaceContext::MutatingUse(MutatingUseContext::Projection) - } else { - PlaceContext::NonMutatingUse(NonMutatingUseContext::Projection) - }; + if context.is_use() { + context = if context.is_mutating_use() { + PlaceContext::MutatingUse(MutatingUseContext::Projection) + } else { + PlaceContext::NonMutatingUse(NonMutatingUseContext::Projection) + }; + } } self.visit_local(&place.local, context, location); |
