rust/tests/ui/lint/dead-code/closure-bang.rs

8 lines
143 B
Rust

#![deny(unreachable_code)]
fn main() {
let x = || -> ! { panic!() };
x();
println!("Foo bar"); //~ ERROR: unreachable statement
}