mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
28 lines
584 B
Rust
28 lines
584 B
Rust
//@ 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));
|
|
}
|