rust/src/test/run-fail/return-never-coerce.rs
2018-12-25 21:08:33 -07:00

16 lines
243 B
Rust

// Test that ! coerces to other types.
// error-pattern:aah!
fn call_another_fn<T, F: FnOnce() -> T>(f: F) -> T {
f()
}
fn wub() -> ! {
panic!("aah!");
}
fn main() {
let x: i32 = call_another_fn(wub);
let y: u32 = wub();
}