mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
12 lines
286 B
Rust
12 lines
286 B
Rust
fn foo(_: impl fn() -> i32) {}
|
|
//~^ ERROR expected identifier, found keyword `fn`
|
|
|
|
fn foo2<T: fn(i32)>(_: T) {}
|
|
//~^ ERROR expected identifier, found keyword `fn`
|
|
|
|
fn main() {
|
|
foo(|| ());
|
|
//~^ mismatched types
|
|
foo2(|_: ()| {});
|
|
//~^ type mismatch in closure arguments
|
|
}
|