Rollup merge of #110826 - cjgillot:place-mention-use, r=JakobDegen,lcnr
Make PlaceMention a non-mutating use. Fixes https://github.com/rust-lang/rust/issues/110781 r? `@JakobDegen` I don't agree with your statement in https://github.com/rust-lang/rust/issues/110781#issuecomment-1520841434. I suggest that we start fixing `PlaceContext` to be accurate enough for optimizations to use it. This structure is very convenient to use in visitors, and we perhaps have an opportunity to make it less of a footgun.
This commit is contained in:
commit
0ac8ebdf11
8 changed files with 49 additions and 10 deletions
|
@ -203,7 +203,9 @@ impl<'mir, 'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> Visitor<'tcx>
|
|||
self.assign(local, DefLocation::Body(location));
|
||||
}
|
||||
|
||||
PlaceContext::NonUse(_) | PlaceContext::MutatingUse(MutatingUseContext::Retag) => {}
|
||||
PlaceContext::NonUse(_)
|
||||
| PlaceContext::NonMutatingUse(NonMutatingUseContext::PlaceMention)
|
||||
| PlaceContext::MutatingUse(MutatingUseContext::Retag) => {}
|
||||
|
||||
PlaceContext::NonMutatingUse(
|
||||
NonMutatingUseContext::Copy | NonMutatingUseContext::Move,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue