]> git.lizzy.rs Git - rust.git/commit - src/tools/clippy
Rollup merge of #69236 - Centril:mut-parens-at-recovery, r=estebank
authorMazdak Farrokhzad <twingoow@gmail.com>
Tue, 18 Feb 2020 21:16:31 +0000 (22:16 +0100)
committerGitHub <noreply@github.com>
Tue, 18 Feb 2020 21:16:31 +0000 (22:16 +0100)
commit6c6d45c6e7ca1e7685e2556d9f58b6f3109c13bf
tree39649c075dab42df78c94de2fafa81466fc7694d
parentc499570b5d287f10adfeb63580c8c92a1d5329c5
parent0b1e08cb557768f168266c7bbcdcb93fcf372a66
Rollup merge of #69236 - Centril:mut-parens-at-recovery, r=estebank

parse: recover `mut (x @ y)` as `(mut x @ mut y)`.

Follow up to https://github.com/rust-lang/rust/pull/68992#discussion_r376829749 and https://github.com/rust-lang/rust/pull/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