diff options
| author | kennytm <kennytm@gmail.com> | 2018-05-01 01:18:40 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-05-01 01:18:40 +0800 |
| commit | cbbdf998edc905bcf44ba212f068114b3a62f858 (patch) | |
| tree | bc16a74fee61bf9eeaedb96eb2dcce767e957496 /src/rustllvm/RustWrapper.cpp | |
| parent | 30c990b69354f9bfb1d7851da931bce2d1efe087 (diff) | |
| parent | 2eb8343af18470d3c48a50c68dbaeb1887b42c37 (diff) | |
| download | rust-cbbdf998edc905bcf44ba212f068114b3a62f858.tar.gz rust-cbbdf998edc905bcf44ba212f068114b3a62f858.zip | |
Rollup merge of #50327 - varkor:match-unused-struct-field, r=estebank
Display correct unused field suggestion for nested struct patterns
Extends https://github.com/rust-lang/rust/pull/47922 by checking more sophisticated patterns (e.g. references, slices, etc.).
Before:
```
warning: unused variable: `bar`
--> src/main.rs:37:21
|
37 | &Foo::Bar { bar } => true,
| ^^^ help: consider using `_bar` instead
|
= note: #[warn(unused_variables)] on by default
```
After:
```
warning: unused variable: `bar`
--> src/main.rs:37:21
|
37 | &Foo::Bar { bar } => true,
| ^^^ help: try ignoring the field: `bar: _`
|
= note: #[warn(unused_variables)] on by default
```
Fixes #50303.
r? @estebank
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
