-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)NLL-soundWorking towards the "invalid code does not compile" goalWorking towards the "invalid code does not compile" goalP-mediumMedium priorityMedium priority
Description
spun off from #47184 and #54570 :
Most of the necessary support for checking lifetime constraints introduced via complex patterns has been added. But one exceptional case which has not been properly dealt with is ref
bindings.
If you look here the code explicitly says "ignore pattern_user_ty
for now."
rust/src/librustc_mir/build/matches/mod.rs
Lines 518 to 526 in 3e6f30e
BindingMode::ByRef(..) => { | |
// If this is a `ref` binding (e.g., `let ref | |
// x: T = ..`), then the type of `x` is not | |
// `T` but rather `&T`, so ignore | |
// `pattern_user_ty` for now. | |
// | |
// FIXME(#47184): extract or handle `pattern_user_ty` somehow | |
pattern_user_ty = None; | |
} |
(I fixed a lot of instances of FIXME(#47184) in PR #55274, but I punted on this one.)
Metadata
Metadata
Assignees
Labels
A-NLLArea: Non-lexical lifetimes (NLL)Area: Non-lexical lifetimes (NLL)NLL-soundWorking towards the "invalid code does not compile" goalWorking towards the "invalid code does not compile" goalP-mediumMedium priorityMedium priority