rust/src/test/compile-fail/closure-that-fails.rs

8 lines
162 B
Rust
Raw Normal View History

fn foo(f: fn() -> !) {}
fn main() {
// Type inference didn't use to be able to handle this:
foo(|| die!());
foo(|| 22); //~ ERROR mismatched types
}