2019-03-18 22:47:07 -05:00
|
|
|
error: unreachable block in `if` expression
|
|
|
|
--> $DIR/expr_if.rs:7:17
|
2017-03-21 08:41:41 -05:00
|
|
|
|
|
2019-03-18 22:47:07 -05:00
|
|
|
LL | if {return} {
|
|
|
|
| _________________^
|
|
|
|
LL | | println!("Hello, world!");
|
|
|
|
LL | | }
|
|
|
|
| |_____^
|
2017-03-21 08:41:41 -05:00
|
|
|
|
|
|
|
|
note: lint level defined here
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/expr_if.rs:4:9
|
2017-03-21 08:41:41 -05:00
|
|
|
|
|
2018-02-22 18:42:32 -06:00
|
|
|
LL | #![deny(unreachable_code)]
|
2017-03-21 08:41:41 -05:00
|
|
|
| ^^^^^^^^^^^^^^^^
|
2019-09-18 17:22:13 -05:00
|
|
|
note: any code following this expression is unreachable
|
|
|
|
--> $DIR/expr_if.rs:7:9
|
|
|
|
|
|
|
|
|
LL | if {return} {
|
|
|
|
| ^^^^^^
|
2019-03-18 22:47:07 -05:00
|
|
|
|
|
|
|
error: unreachable statement
|
|
|
|
--> $DIR/expr_if.rs:27:5
|
|
|
|
|
|
|
|
|
LL | println!("But I am.");
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2019-09-18 17:22:13 -05:00
|
|
|
note: any code following this expression is unreachable
|
|
|
|
--> $DIR/expr_if.rs:21:9
|
|
|
|
|
|
|
|
|
LL | return;
|
|
|
|
| ^^^^^^
|
2017-11-21 13:48:35 -06:00
|
|
|
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
|
2017-03-21 08:41:41 -05:00
|
|
|
|
2019-03-18 22:47:07 -05:00
|
|
|
error: aborting due to 2 previous errors
|
2017-03-21 08:41:41 -05:00
|
|
|
|