diff options
| author | ThibsG <thebaek1@hotmail.com> | 2020-01-10 15:12:21 +0100 |
|---|---|---|
| committer | ThibsG <thebaek1@hotmail.com> | 2020-01-13 16:25:35 +0100 |
| commit | d3c76b5b2a803030d9be4e66c540120d86e3868a (patch) | |
| tree | a1b8565f085c55db1c661ef19e96f848ab5dfbab | |
| parent | 95cc500e9d4ff3bc707438b6a5e11397c232cd61 (diff) | |
| download | rust-d3c76b5b2a803030d9be4e66c540120d86e3868a.tar.gz rust-d3c76b5b2a803030d9be4e66c540120d86e3868a.zip | |
Change note message
| -rw-r--r-- | clippy_lints/src/matches.rs | 5 | ||||
| -rw-r--r-- | tests/ui/matches.stderr | 16 |
2 files changed, 10 insertions, 11 deletions
diff --git a/clippy_lints/src/matches.rs b/clippy_lints/src/matches.rs index 308401229ac..ee7155c1a0b 100644 --- a/clippy_lints/src/matches.rs +++ b/clippy_lints/src/matches.rs @@ -530,10 +530,9 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr<'_>, arms: &[Arm<'_>]) span_note_and_lint(cx, MATCH_WILD_ERR_ARM, arm.pat.span, - &format!("`Err({})` will match all errors, maybe not a good idea", &ident_bind_name), + &format!("`Err({})` matches all errors", &ident_bind_name), arm.pat.span, - "to remove this warning, match each error separately \ - or use `unreachable!` macro" + "match each error separately or use the error output", ); } } diff --git a/tests/ui/matches.stderr b/tests/ui/matches.stderr index dd8014073df..1c5c636fee6 100644 --- a/tests/ui/matches.stderr +++ b/tests/ui/matches.stderr @@ -1,11 +1,11 @@ -error: `Err(_)` will match all errors, maybe not a good idea +error: `Err(_)` matches all errors --> $DIR/matches.rs:14:9 | LL | Err(_) => panic!("err"), | ^^^^^^ | = note: `-D clippy::match-wild-err-arm` implied by `-D warnings` - = note: to remove this warning, match each error separately or use `unreachable!` macro + = note: match each error separately or use the error output error: this `match` has identical arm bodies --> $DIR/matches.rs:13:18 @@ -26,13 +26,13 @@ LL | Ok(3) => println!("ok"), | ^^^^^ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) -error: `Err(_)` will match all errors, maybe not a good idea +error: `Err(_)` matches all errors --> $DIR/matches.rs:20:9 | LL | Err(_) => panic!(), | ^^^^^^ | - = note: to remove this warning, match each error separately or use `unreachable!` macro + = note: match each error separately or use the error output error: this `match` has identical arm bodies --> $DIR/matches.rs:19:18 @@ -52,13 +52,13 @@ LL | Ok(3) => println!("ok"), | ^^^^^ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) -error: `Err(_)` will match all errors, maybe not a good idea +error: `Err(_)` matches all errors --> $DIR/matches.rs:26:9 | LL | Err(_) => { | ^^^^^^ | - = note: to remove this warning, match each error separately or use `unreachable!` macro + = note: match each error separately or use the error output error: this `match` has identical arm bodies --> $DIR/matches.rs:25:18 @@ -78,13 +78,13 @@ LL | Ok(3) => println!("ok"), | ^^^^^ = note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info) -error: `Err(_e)` will match all errors, maybe not a good idea +error: `Err(_e)` matches all errors --> $DIR/matches.rs:34:9 | LL | Err(_e) => panic!(), | ^^^^^^^ | - = note: to remove this warning, match each error separately or use `unreachable!` macro + = note: match each error separately or use the error output error: this `match` has identical arm bodies --> $DIR/matches.rs:33:18 |
