rust/src/test/ui/reachable/expr_box.stderr
Aaron Hill 822393d690
Point at original span when emitting unreachable lint
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.
2019-09-18 18:35:10 -04:00

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