rust/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
286 B
Rust
Raw Normal View History

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
}