2020-10-14 15:27:48 -05:00
|
|
|
//@ run-rustfix
|
|
|
|
#![allow(unused)]
|
|
|
|
fn a() => usize { 0 }
|
|
|
|
//~^ ERROR return types are denoted using `->`
|
|
|
|
|
2020-10-15 14:21:45 -05:00
|
|
|
fn b(): usize { 0 }
|
|
|
|
//~^ ERROR return types are denoted using `->`
|
|
|
|
|
2020-10-14 15:27:48 -05:00
|
|
|
fn bar(_: u32) {}
|
|
|
|
|
|
|
|
fn baz() -> *const dyn Fn(u32) { unimplemented!() }
|
|
|
|
|
|
|
|
fn foo() {
|
|
|
|
match () {
|
|
|
|
_ if baz() == &bar as &dyn Fn(u32) => (),
|
|
|
|
() => (),
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
2020-10-15 14:21:45 -05:00
|
|
|
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));
|
2020-10-14 15:27:48 -05:00
|
|
|
}
|