Rollup merge of #79080 - camelid:mir-visit-debuginfo-project, r=jonas-schievink
MIR visitor: Don't treat debuginfo field access as a use of the struct Fixes #77454. r? `@jonas-schievink`
This commit is contained in:
commit
d4a05696d9
2 changed files with 9 additions and 12 deletions
|
@ -1017,11 +1017,14 @@ 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() {
|
||||
// ^ Only change the context if it is a real use, not a "use" in debuginfo.
|
||||
context = if context.is_mutating_use() {
|
||||
PlaceContext::MutatingUse(MutatingUseContext::Projection)
|
||||
} else {
|
||||
PlaceContext::NonMutatingUse(NonMutatingUseContext::Projection)
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
self.visit_local(&place.local, context, location);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue