-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
False positive on collapsible_if with if let #1197
Comments
Commits that seems to add
There isn't much explanation about why this is done that way. But it certainly seems surprising because it leads to very unintuitive errors. I think we should report that on rustc's issue tracker. |
rust-lang/rust#28449 is closed. rust-lang/rust#37510 is another issue for it that's still open. |
This must be fixed by now, especially with NLL. |
This is from linefeed:
If you try to collapse this, rustc won't have it:
The difference appears to be that the
else if
part of anif let
desugars to a guard. And guards appear to have different borrowing rules than simpleif
expressions (I'm not sure why). Perhaps that is a bug in borrowck, but as long as it is there, we should at least note it in the docs.The text was updated successfully, but these errors were encountered: