Closed
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
(I fixed a lot of instances of FIXME(#47184) in PR #55274, but I punted on this one.)
Metadata
Metadata
Assignees
Labels
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
nikomatsakis commentedon Oct 30, 2018
@pnkfelix do you have an example of a program that fails to error as a result of this bug?
pnkfelix commentedon Oct 30, 2018
I think this should error, but does not under NLL today:
pnkfelix commentedon Oct 30, 2018
(this may not be that hard to fix. I punted because the other cases seemed way more important to get fixed ASAP, but its possible that a similar pattern can work for this too.)
pnkfelix commentedon Oct 30, 2018
I don't think any fix for this is worth the effort of backporting, though... its a really subtle case.
davidtwco commentedon Nov 24, 2018
Update: Got confused by migration mode, this isn't fixed.
The test case in this issue now errors correctly under NLL, seems to have been changed by #55274, but that PR description says:Auto merge of #55937 - davidtwco:issue-54943, r=pnkfelix