diff options
Diffstat (limited to 'tests/ui/never_type/never-assign-dead-code.rs')
-rw-r--r-- | tests/ui/never_type/never-assign-dead-code.rs | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/ui/never_type/never-assign-dead-code.rs b/tests/ui/never_type/never-assign-dead-code.rs new file mode 100644 index 000000000..7bb7c8709 --- /dev/null +++ b/tests/ui/never_type/never-assign-dead-code.rs @@ -0,0 +1,12 @@ +// Test that an assignment of type ! makes the rest of the block dead code. + +// check-pass + +#![feature(never_type)] +#![warn(unused)] + +fn main() { + let x: ! = panic!("aah"); //~ WARN unused + drop(x); //~ WARN unreachable + //~^ WARN unreachable +} |