2019-12-11 08:51:28 -06:00
|
|
|
#![feature(never_type)]
|
|
|
|
|
2018-01-19 13:58:46 -06:00
|
|
|
enum Helper<T, U> {
|
|
|
|
T(T, [!; 0]),
|
|
|
|
#[allow(dead_code)]
|
|
|
|
U(U),
|
|
|
|
}
|
|
|
|
|
|
|
|
fn transmute<T, U>(t: T) -> U {
|
2018-01-19 15:00:35 -06:00
|
|
|
let Helper::U(u) = Helper::T(t, []);
|
2022-12-23 14:02:23 -06:00
|
|
|
//~^ ERROR refutable pattern in local binding
|
|
|
|
//~| `Helper::T(_, _)` not covered
|
2018-01-19 13:58:46 -06:00
|
|
|
u
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
println!("{:?}", transmute::<&str, (*const u8, u64)>("type safety"));
|
|
|
|
}
|