summaryrefslogtreecommitdiffstats
path: root/tests/ui/parser/recover-fn-trait-from-fn-kw.rs
blob: b6611e6273d37c429d53871a4a074a70bbc696b5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
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
}