summaryrefslogtreecommitdiffstats
path: root/src/test/ui/fn/fn-recover-return-sign.rs
blob: 0656023c0f8989c0aa8f68317f8af88310e8fa1f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// run-rustfix
#![allow(unused)]
fn a() => usize { 0 }
//~^ ERROR return types are denoted using `->`

fn b(): usize { 0 }
//~^ ERROR return types are denoted using `->`

fn bar(_: u32) {}

fn baz() -> *const dyn Fn(u32) { unimplemented!() }

fn foo() {
    match () {
        _ if baz() == &bar as &dyn Fn(u32) => (),
        () => (),
    }
}

fn main() {
    let foo = |a: bool| => bool { a };
    //~^ ERROR return types are denoted using `->`
    dbg!(foo(false));

    let bar = |a: bool|: bool { a };
    //~^ ERROR return types are denoted using `->`
    dbg!(bar(false));
}