822393d690
Fixes #64590 When we emit an 'unreachable' lint, we now add a note pointing at the expression that actually causes the code to be unreachable (e.g. `return`, `break`, `panic`). This is especially useful when macros are involved, since a diverging expression might be hidden inside of a macro invocation.
20 lines
435 B
Plaintext
20 lines
435 B
Plaintext
error: unreachable expression
|
|
--> $DIR/expr_box.rs:6:13
|
|
|
|
|
LL | let x = box return;
|
|
| ^^^^^^^^^^
|
|
|
|
|
note: lint level defined here
|
|
--> $DIR/expr_box.rs:3:9
|
|
|
|
|
LL | #![deny(unreachable_code)]
|
|
| ^^^^^^^^^^^^^^^^
|
|
note: any code following this expression is unreachable
|
|
--> $DIR/expr_box.rs:6:17
|
|
|
|
|
LL | let x = box return;
|
|
| ^^^^^^
|
|
|
|
error: aborting due to previous error
|
|
|