summaryrefslogtreecommitdiffstats
path: root/src/test/ui/reachable/expr_cast.rs
blob: e8e477ea4f6849aec68d7c03fc9ba2085393a8cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
#![allow(unused_variables)]
#![allow(unused_assignments)]
#![allow(dead_code)]
#![deny(unreachable_code)]
#![feature(never_type, type_ascription)]

fn a() {
    // the cast is unreachable:
    let x = {return} as !; //~ ERROR unreachable
    //~| ERROR non-primitive cast
}

fn main() { }