Skip to content
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

Merged
merged 1 commit into from
Feb 10, 2020
Merged

Conversation

matthewjasper
Copy link
Contributor

r? @Centril

Closes #67861
Closes #67926

@matthewjasper matthewjasper added the F-bindings_after_at `#![feature(bindings_after_at)]` label Feb 9, 2020
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Feb 9, 2020
self.0 = true;
// Don't recurse into the subpattern, mut on the outer
// binding doesn't affect the inner bindings.
Copy link
Contributor

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Addressed in #69236.

@Centril
Copy link
Contributor

Centril commented Feb 10, 2020

Thanks! 😊 @bors r+ rollup

@bors
Copy link
Contributor

bors commented Feb 10, 2020

📌 Commit fa5a3c3 has been approved by Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Feb 10, 2020
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Feb 10, 2020
bors added a commit that referenced this pull request Feb 10, 2020
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
@bors bors merged commit fa5a3c3 into rust-lang:master Feb 10, 2020
@matthewjasper matthewjasper deleted the imm-binding-after-at branch February 10, 2020 14:09
Centril added a commit to Centril/rust that referenced this pull request Feb 18, 2020
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
F-bindings_after_at `#![feature(bindings_after_at)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bindings_after_at: outer mutability annotation affects inner bindings Wrong bindings_after_at warnings
4 participants