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:
Matthias Krüger 2023-05-04 19:18:19 +02:00 committed by GitHub
commit 0ac8ebdf11
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 49 additions and 10 deletions

View file

@ -752,6 +752,7 @@ impl Visitor<'_> for CanConstProp {
| NonMutatingUse(NonMutatingUseContext::Move)
| NonMutatingUse(NonMutatingUseContext::Inspect)
| NonMutatingUse(NonMutatingUseContext::Projection)
| NonMutatingUse(NonMutatingUseContext::PlaceMention)
| NonUse(_) => {}
// These could be propagated with a smarter analysis or just some careful thinking about