about summary refs log tree commit diff
path: root/tests/ui/parser/recover/recover-fn-trait-from-fn-kw.rs
blob: 1f19f4b9c064b780ed22aac384f6c998a4b67625 (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(|| ());
    //~^ ERROR mismatched types
    foo2(|_: ()| {});
    //~^ ERROR type mismatch in closure arguments
}