mirror of
https://github.com/rust-lang/rust.git
synced 2025-02-19 02:13:57 +00:00

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.
8 lines
143 B
Rust
8 lines
143 B
Rust
#![deny(unreachable_code)]
|
|
|
|
fn main() {
|
|
let x = || -> ! { panic!() };
|
|
x();
|
|
println!("Foo bar"); //~ ERROR: unreachable statement
|
|
}
|