Files
rust/compiler
Guillaume Gomez d259d1d98a 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.
2021-03-02 00:50:09 +01:00
..
2020-09-11 09:37:51 -07:00
2021-02-14 18:03:11 +03:00
2021-02-20 17:19:30 -05:00
2021-02-20 10:51:26 +01:00
2021-02-07 23:48:58 -08:00
2021-02-21 12:22:22 +01:00
2021-02-21 12:22:22 +01:00