Make note better when all arms in a match diverge

This commit is contained in:
Aaron Hill 2019-09-18 19:07:39 -04:00
parent 822393d690
commit cd4b468e07
No known key found for this signature in database
GPG key ID: B4087E510E98B164
4 changed files with 60 additions and 16 deletions

View file

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