about summary refs log tree commit diff
path: root/src/test/ui/expr
diff options
context:
space:
mode:
authorCamelid <camelidcamel@gmail.com>2020-12-05 13:12:39 -0800
committerCamelid <camelidcamel@gmail.com>2021-02-18 16:21:16 -0800
commit5d2a2a1caa1a12a5c445fcc99e2dee42e5a5f3d7 (patch)
tree29e1de6b2a08f595a3bbc550e0c0915caed7524e /src/test/ui/expr
parent0148b971c921a0831fbf3357e5936eec724e3566 (diff)
downloadrust-5d2a2a1caa1a12a5c445fcc99e2dee42e5a5f3d7.tar.gz
rust-5d2a2a1caa1a12a5c445fcc99e2dee42e5a5f3d7.zip
Add explanations and suggestions to `irrefutable_let_patterns` lint
Diffstat (limited to 'src/test/ui/expr')
-rw-r--r--src/test/ui/expr/if/if-let.stderr16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/test/ui/expr/if/if-let.stderr b/src/test/ui/expr/if/if-let.stderr
index 468e913a773..c64c9093ee5 100644
--- a/src/test/ui/expr/if/if-let.stderr
+++ b/src/test/ui/expr/if/if-let.stderr
@@ -10,6 +10,8 @@ LL | |     });
    | |_______- in this macro invocation
    |
    = note: `#[warn(irrefutable_let_patterns)]` on by default
+   = note: this pattern will always match, so the `if let` is useless
+   = help: consider replacing the `if let` with a `let`
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
 warning: irrefutable `if let` pattern
@@ -23,6 +25,8 @@ LL | |         println!("irrefutable pattern");
 LL | |     });
    | |_______- in this macro invocation
    |
+   = note: this pattern will always match, so the `if let` is useless
+   = help: consider replacing the `if let` with a `let`
    = note: this warning originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)
 
 warning: irrefutable `if let` pattern
@@ -32,6 +36,9 @@ LL | /     if let a = 1 {
 LL | |         println!("irrefutable pattern");
 LL | |     }
    | |_____^
+   |
+   = note: this pattern will always match, so the `if let` is useless
+   = help: consider replacing the `if let` with a `let`
 
 warning: irrefutable `if let` pattern
   --> $DIR/if-let.rs:30:5
@@ -44,6 +51,9 @@ LL | |     } else {
 LL | |         println!("else in irrefutable `if let`");
 LL | |     }
    | |_____^
+   |
+   = note: this pattern will always match, so the `if let` is useless
+   = help: consider replacing the `if let` with a `let`
 
 warning: irrefutable `if let` pattern
   --> $DIR/if-let.rs:40:12
@@ -53,6 +63,9 @@ LL |       } else if let a = 1 {
 LL | |         println!("irrefutable pattern");
 LL | |     }
    | |_____^
+   |
+   = note: this pattern will always match, so the `if let` is useless
+   = help: consider replacing the `if let` with a `let`
 
 warning: irrefutable `if let` pattern
   --> $DIR/if-let.rs:46:12
@@ -62,6 +75,9 @@ LL |       } else if let a = 1 {
 LL | |         println!("irrefutable pattern");
 LL | |     }
    | |_____^
+   |
+   = note: this pattern will always match, so the `if let` is useless
+   = help: consider replacing the `if let` with a `let`
 
 warning: 6 warnings emitted