From 5d2a2a1caa1a12a5c445fcc99e2dee42e5a5f3d7 Mon Sep 17 00:00:00 2001 From: Camelid Date: Sat, 5 Dec 2020 13:12:39 -0800 Subject: Add explanations and suggestions to `irrefutable_let_patterns` lint --- src/test/ui/expr/if/if-let.stderr | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/test/ui/expr') 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 -- cgit 1.4.1-3-g733a5