File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -312,14 +312,17 @@ impl EarlyLintPass for MiscEarlyLints {
312312
313313 if let PatKind :: Ident ( _, ident, Some ( ref right) ) = pat. node {
314314 if let PatKind :: Wild = right. node {
315- span_lint (
315+ span_lint_and_sugg (
316316 cx,
317317 REDUNDANT_PATTERN ,
318318 pat. span ,
319319 & format ! (
320320 "the `{} @ _` pattern can be written as just `{}`" ,
321321 ident. name, ident. name,
322322 ) ,
323+ "try" ,
324+ format ! ( "{}" , ident. name) ,
325+ Applicability :: MachineApplicable ,
323326 ) ;
324327 }
325328 }
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ error: the `y @ _` pattern can be written as just `y`
22 --> $DIR/patterns.rs:10:9
33 |
44LL | y @ _ => (),
5- | ^^^^^
5+ | ^^^^^ help: try: `y`
66 |
77 = note: `-D clippy::redundant-pattern` implied by `-D warnings`
88
You can’t perform that action at this time.
0 commit comments