]> git.lizzy.rs Git - rust.git/blob - src/test/ui/fn/fn-recover-return-sign.rs
Merge commit 'b7f3f7f6082679da2da9a0b3faf1b5adef3afd3b' into clippyup
[rust.git] / src / test / ui / fn / fn-recover-return-sign.rs
1 // run-rustfix
2 #![allow(unused)]
3 fn a() => usize { 0 }
4 //~^ ERROR return types are denoted using `->`
5
6 fn b(): usize { 0 }
7 //~^ ERROR return types are denoted using `->`
8
9 fn bar(_: u32) {}
10
11 fn baz() -> *const dyn Fn(u32) { unimplemented!() }
12
13 fn foo() {
14     match () {
15         _ if baz() == &bar as &dyn Fn(u32) => (),
16         () => (),
17     }
18 }
19
20 fn main() {
21     let foo = |a: bool| => bool { a };
22     //~^ ERROR return types are denoted using `->`
23     dbg!(foo(false));
24
25     let bar = |a: bool|: bool { a };
26     //~^ ERROR return types are denoted using `->`
27     dbg!(bar(false));
28 }