summaryrefslogtreecommitdiffstats
path: root/tests/ui/empty/empty-never-array.rs
blob: fd93346101d846778efb629f929afc4d99c25012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#![feature(never_type)]

enum Helper<T, U> {
    T(T, [!; 0]),
    #[allow(dead_code)]
    U(U),
}

fn transmute<T, U>(t: T) -> U {
    let Helper::U(u) = Helper::T(t, []);
    //~^ ERROR refutable pattern in local binding
    //~| `Helper::T(_, _)` not covered
    u
}

fn main() {
    println!("{:?}", transmute::<&str, (*const u8, u64)>("type safety"));
}