diff options
| author | Guillaume Gomez <guillaume1.gomez@gmail.com> | 2021-03-02 00:50:09 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-03-02 00:50:09 +0100 |
| commit | d259d1d98a31b299d8c64abf5be429468329dec8 (patch) | |
| tree | a32fbe047b2e95200daf2c97260bf131cab69309 /compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp | |
| parent | 5a82251e9207e9dbec619e92a5072b688b83aa45 (diff) | |
| parent | 3c63f67802c728bd84953c19735fabd8f071c326 (diff) | |
| download | rust-d259d1d98a31b299d8c64abf5be429468329dec8.tar.gz rust-d259d1d98a31b299d8c64abf5be429468329dec8.zip | |
Rollup merge of #82655 - SkiFire13:fix-issue-81314, r=estebank
Highlight identifier span instead of whole pattern span in `unused` lint
Fixes #81314
This pretty much just changes the span highlighted in the lint from `pat_sp` to `ident.span`. There's however an exception, which is in patterns with shorthands like `Point { y, ref mut x }`, where a suggestion to change just `x` would be invalid; in those cases I had to keep the pattern span. Another option would be suggesting something like `Point { y, x: ref mut _x }`.
I also added a new test since there weren't any test that checked the `unused` lint with optional patterns.
Diffstat (limited to 'compiler/rustc_llvm/llvm-wrapper/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions
