]> git.lizzy.rs Git - rust.git/blob - tests/ui/reachable/expr_if.stderr
Rollup merge of #106701 - ibraheemdev:sync-sender-spin, r=Amanieu
[rust.git] / tests / ui / reachable / expr_if.stderr
1 error: unreachable block in `if` or `while` expression
2   --> $DIR/expr_if.rs:7:17
3    |
4 LL |       if {return} {
5    |  _________------__^
6    | |         |
7    | |         any code following this expression is unreachable
8 LL | |         println!("Hello, world!");
9 LL | |     }
10    | |_____^ unreachable block in `if` or `while` expression
11    |
12 note: the lint level is defined here
13   --> $DIR/expr_if.rs:4:9
14    |
15 LL | #![deny(unreachable_code)]
16    |         ^^^^^^^^^^^^^^^^
17
18 error: unreachable statement
19   --> $DIR/expr_if.rs:27:5
20    |
21 LL |         return;
22    |         ------ any code following this expression is unreachable
23 ...
24 LL |     println!("But I am.");
25    |     ^^^^^^^^^^^^^^^^^^^^^ unreachable statement
26    |
27    = note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
28
29 error: aborting due to 2 previous errors
30