Skip to content

Commit 6e89bd0

Browse files
committed
Change note message
1 parent 058fe74 commit 6e89bd0

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

clippy_lints/src/matches.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -530,10 +530,9 @@ fn check_wild_err_arm(cx: &LateContext<'_, '_>, ex: &Expr<'_>, arms: &[Arm<'_>])
530530
span_note_and_lint(cx,
531531
MATCH_WILD_ERR_ARM,
532532
arm.pat.span,
533-
&format!("`Err({})` will match all errors, maybe not a good idea", &ident_bind_name),
533+
&format!("`Err({})` matches all errors", &ident_bind_name),
534534
arm.pat.span,
535-
"to remove this warning, match each error separately \
536-
or use `unreachable!` macro"
535+
"match each error separately or use the error output",
537536
);
538537
}
539538
}

tests/ui/matches.stderr

+8-8
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
error: `Err(_)` will match all errors, maybe not a good idea
1+
error: `Err(_)` matches all errors
22
--> $DIR/matches.rs:14:9
33
|
44
LL | Err(_) => panic!("err"),
55
| ^^^^^^
66
|
77
= note: `-D clippy::match-wild-err-arm` implied by `-D warnings`
8-
= note: to remove this warning, match each error separately or use `unreachable!` macro
8+
= note: match each error separately or use the error output
99

1010
error: this `match` has identical arm bodies
1111
--> $DIR/matches.rs:13:18
@@ -26,13 +26,13 @@ LL | Ok(3) => println!("ok"),
2626
| ^^^^^
2727
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
2828

29-
error: `Err(_)` will match all errors, maybe not a good idea
29+
error: `Err(_)` matches all errors
3030
--> $DIR/matches.rs:20:9
3131
|
3232
LL | Err(_) => panic!(),
3333
| ^^^^^^
3434
|
35-
= note: to remove this warning, match each error separately or use `unreachable!` macro
35+
= note: match each error separately or use the error output
3636

3737
error: this `match` has identical arm bodies
3838
--> $DIR/matches.rs:19:18
@@ -52,13 +52,13 @@ LL | Ok(3) => println!("ok"),
5252
| ^^^^^
5353
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
5454

55-
error: `Err(_)` will match all errors, maybe not a good idea
55+
error: `Err(_)` matches all errors
5656
--> $DIR/matches.rs:26:9
5757
|
5858
LL | Err(_) => {
5959
| ^^^^^^
6060
|
61-
= note: to remove this warning, match each error separately or use `unreachable!` macro
61+
= note: match each error separately or use the error output
6262

6363
error: this `match` has identical arm bodies
6464
--> $DIR/matches.rs:25:18
@@ -78,13 +78,13 @@ LL | Ok(3) => println!("ok"),
7878
| ^^^^^
7979
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
8080

81-
error: `Err(_e)` will match all errors, maybe not a good idea
81+
error: `Err(_e)` matches all errors
8282
--> $DIR/matches.rs:34:9
8383
|
8484
LL | Err(_e) => panic!(),
8585
| ^^^^^^^
8686
|
87-
= note: to remove this warning, match each error separately or use `unreachable!` macro
87+
= note: match each error separately or use the error output
8888

8989
error: this `match` has identical arm bodies
9090
--> $DIR/matches.rs:33:18

0 commit comments

Comments
 (0)