Make note better when all arms in a match diverge
This commit is contained in:
parent
822393d690
commit
cd4b468e07
4 changed files with 60 additions and 16 deletions
|
|
@ -9,11 +9,11 @@ note: lint level defined here
|
|||
|
|
||||
LL | #![deny(unreachable_code)]
|
||||
| ^^^^^^^^^^^^^^^^
|
||||
note: any code following this expression is unreachable
|
||||
--> $DIR/expr_match.rs:7:22
|
||||
note: any code following this `match` expression is unreachable, as all arms diverge
|
||||
--> $DIR/expr_match.rs:7:5
|
||||
|
|
||||
LL | match () { () => return }
|
||||
| ^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= 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: unreachable statement
|
||||
|
|
@ -22,11 +22,11 @@ error: unreachable statement
|
|||
LL | println!("I am dead");
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
|
||||
note: any code following this expression is unreachable
|
||||
--> $DIR/expr_match.rs:18:31
|
||||
note: any code following this `match` expression is unreachable, as all arms diverge
|
||||
--> $DIR/expr_match.rs:18:5
|
||||
|
|
||||
LL | match () { () if false => return, () => return }
|
||||
| ^^^^^^
|
||||
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
= 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: aborting due to 2 previous errors
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue