rust/tests/ui/closures/add_semicolon_non_block_closure.rs
2024-08-19 11:08:51 +08:00

13 lines
210 B
Rust

fn foo(_f: impl Fn()) {}
fn bar() -> i32 {
1
}
fn main() {
foo(|| bar())
//~^ ERROR mismatched types [E0308]
//~| HELP consider using a semicolon here
//~| HELP try adding a return type
}