mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-24 07:44:10 +00:00
d7ed5a52ff
This test was ignored long ago in https://github.com/rust-lang/rust/pull/20578/ when the syntax for closures was changed. The current status is that a closure with an explicit `!` return type will trigger the `unreachable_code` lint which appears to be the original intent of the test (https://github.com/rust-lang/rust/pull/16836). A closure without a return type won't trigger the lint since the `!` type isn't inferred (AFAIK). This restores the test to its original form.
18 lines
522 B
Plaintext
18 lines
522 B
Plaintext
error: unreachable statement
|
|
--> $DIR/closure-bang.rs:6:5
|
|
|
|
|
LL | x();
|
|
| --- any code following this expression is unreachable
|
|
LL | println!("Foo bar");
|
|
| ^^^^^^^^^^^^^^^^^^^ unreachable statement
|
|
|
|
|
note: the lint level is defined here
|
|
--> $DIR/closure-bang.rs:1:9
|
|
|
|
|
LL | #![deny(unreachable_code)]
|
|
| ^^^^^^^^^^^^^^^^
|
|
= note: this error originates in the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
|
|
|
|
error: aborting due to previous error
|
|
|