blob: 3de2b1a78a3dadfca2e8c0766d0db69b1eb3f2eb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
#![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"));
}
|