-
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
Correctly parse mut a @ b
#68992
Correctly parse mut a @ b
#68992
Conversation
self.0 = true; | ||
// Don't recurse into the subpattern, mut on the outer | ||
// binding doesn't affect the inner bindings. |
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.
Although this would prevent mut (x @ y)
from turning into mut x @ mut y
but that seems fine.
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.
Addressed in #69236.
Thanks! 😊 @bors r+ rollup |
📌 Commit fa5a3c3 has been approved by |
… r=Centril Correctly parse `mut a @ b` r? @Centril Closes rust-lang#67861 Closes rust-lang#67926
Rollup of 6 pull requests Successful merges: - #68694 (Reduce the number of `RefCell`s in `InferCtxt`.) - #68966 (Improve performance of coherence checks) - #68976 (Make `num::NonZeroX::new` an unstable `const fn`) - #68992 (Correctly parse `mut a @ b`) - #69005 (Small graphviz improvements for the new dataflow framework) - #69006 (parser: Keep current and previous tokens precisely) Failed merges: r? @ghost
…stebank parse: recover `mut (x @ y)` as `(mut x @ mut y)`. Follow up to rust-lang#68992 (comment) and rust-lang#63945. Specifically, when given `let mut (x @ y)` we recover with `let (mut x @ mut y)` as the suggestion: ```rust error: `mut` must be attached to each individual binding --> $DIR/mut-patterns.rs:12:9 | LL | let mut (x @ y) = 0; | ^^^^^^^^^^^ help: add `mut` to each binding: `(mut x @ mut y)` | = note: `mut` may be followed by `variable` and `variable @ pattern` ``` r? @matthewjasper @estebank
r? @Centril
Closes #67861
Closes #67926