summaryrefslogtreecommitdiffstats
path: root/tests/ui/never_type/never-assign-dead-code.rs
blob: 39df7de5a7fbb9dc51322ada7f290032a7cd7c51 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
// Test that an assignment of type ! makes the rest of the block dead code.

// check-pass

#![feature(never_type)]
#![allow(dropping_copy_types)]
#![warn(unused)]

fn main() {
    let x: ! = panic!("aah"); //~ WARN unused
    drop(x); //~ WARN unreachable
    //~^ WARN unreachable
}