rust/src/test/ui/never-assign-dead-code.rs
2019-07-03 06:30:28 +09:00

13 lines
291 B
Rust

// Test that an assignment of type ! makes the rest of the block dead code.
#![feature(never_type)]
// build-pass (FIXME(62277): could be check-pass?)
#![warn(unused)]
fn main() {
let x: ! = panic!("aah"); //~ WARN unused
drop(x); //~ WARN unreachable
//~^ WARN unreachable
}