-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Match binding is assignment #12508
Match binding is assignment #12508
Conversation
Can you elaborate some more in the commit message about what the bug was and how this fixes it? |
Added more description in commit message. Also tweaked the fix a little bit to follow the convention of existing code more closely. |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your | ||
// option. This file may not be copied, modified, or distributed | ||
// except according to those terms. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a small description to these tests about what they are supposed to do and the bug that they're testing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Also, what @flaper87 said. Something like "// Test that immutable pattern bindings cannot be reassigned." |
r? |
@edwardw Could you squash those commits? Also, I think those tests could live in the same file. Not sure what others think but I'd prefer having just 1 |
@flaper87, can one compile-fail test have multiple failures? |
In its first pass, namely gather_loans, the borrow checker tracks the initialization sites among other things it does. It does so for let bindings with initializers but not for bindings in match arms, which are effectively also assignments. This patch does that for borrow checker. Closes rust-lang#12452.
r? |
fix: Don't respond to cancelled requests when retrying them Fixes rust-lang/rust-analyzer#12482
Fix infinite loop in `cast_sign_loss` when peeling unwrap method calls Fixes rust-lang#12506 The lint wants to peel method calls but didn't actually reassign the expression, leading to an infinite loop. ---- changelog: Fix infinite loop in [`cast_sign_loss`] when having two chained `.unwrap()` calls
Fix infinite loop in `cast_sign_loss` when peeling unwrap method calls Fixes rust-lang#12506 The lint wants to peel method calls but didn't actually reassign the expression, leading to an infinite loop. ---- changelog: Fix infinite loop in [`cast_sign_loss`] when having two chained `.unwrap()` calls
Fix infinite loop in `cast_sign_loss` when peeling unwrap method calls Fixes rust-lang#12506 The lint wants to peel method calls but didn't actually reassign the expression, leading to an infinite loop. ---- changelog: Fix infinite loop in [`cast_sign_loss`] when having two chained `.unwrap()` calls
In its first pass, namely gather_loans, the borrow checker tracks the
initialization sites among other things it does. It does so for let
bindings with initializers but not for bindings in match arms, which are
effectively also assignments. This patch does that for borrow checker.
Closes #12452.