2021-08-08 09:49:13 -05:00
|
|
|
error: unreachable block in `if` or `while` expression
|
2019-06-20 03:29:42 -05:00
|
|
|
--> $DIR/expr_while.rs:7:20
|
2017-03-21 08:41:41 -05:00
|
|
|
|
|
2019-06-20 03:29:42 -05:00
|
|
|
LL | while {return} {
|
2019-09-21 14:33:02 -05:00
|
|
|
| ____________------__^
|
|
|
|
| | |
|
|
|
|
| | any code following this expression is unreachable
|
2019-06-20 03:29:42 -05:00
|
|
|
LL | |
|
|
|
|
LL | | println!("Hello, world!");
|
|
|
|
LL | | }
|
2021-08-08 09:49:13 -05:00
|
|
|
| |_____^ unreachable block in `if` or `while` expression
|
2017-03-21 08:41:41 -05:00
|
|
|
|
|
2020-01-22 17:57:38 -06:00
|
|
|
note: the lint level is defined here
|
2018-12-25 09:56:47 -06:00
|
|
|
--> $DIR/expr_while.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
|
|
|
| ^^^^^^^^^^^^^^^^
|
|
|
|
|
2021-08-08 09:49:13 -05:00
|
|
|
error: unreachable block in `if` or `while` expression
|
2019-06-20 03:29:42 -05:00
|
|
|
--> $DIR/expr_while.rs:22:20
|
2017-03-21 08:41:41 -05:00
|
|
|
|
|
2019-06-20 03:29:42 -05:00
|
|
|
LL | while {return} {
|
2019-09-21 14:33:02 -05:00
|
|
|
| ____________------__^
|
|
|
|
| | |
|
|
|
|
| | any code following this expression is unreachable
|
2019-06-20 03:29:42 -05:00
|
|
|
LL | |
|
|
|
|
LL | | println!("I am dead.");
|
|
|
|
LL | | }
|
2021-08-08 09:49:13 -05:00
|
|
|
| |_____^ unreachable block in `if` or `while` expression
|
2017-03-21 08:41:41 -05:00
|
|
|
|
2019-06-20 03:29:42 -05:00
|
|
|
error: aborting due to 2 previous errors
|
2017-03-21 08:41:41 -05:00
|
|
|
|