Change note message

This commit is contained in:
ThibsG 2020-01-10 15:12:21 +01:00
parent 95cc500e9d
commit d3c76b5b2a
2 changed files with 10 additions and 11 deletions

View File

@ -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",
);
}
}

View File

@ -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