summaryrefslogtreecommitdiffstats
path: root/tests/ui/fn/suggest-return-future.rs
blob: 750740d9426106edfa5dda3798eda6eb7132af49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// edition: 2021

async fn a() -> i32 {
    0
}

fn foo() -> _ {
    //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types [E0121]
    //~| NOTE not allowed in type signatures
    //~| HELP replace with an appropriate return type
    //~| SUGGESTION impl Future<Output = i32>
    a()
}

fn bar() -> _ {
    //~^ ERROR the placeholder `_` is not allowed within types on item signatures for return types [E0121]
    //~| NOTE not allowed in type signatures
    //~| HELP replace with an appropriate return type
    //~| SUGGESTION impl Future<Output = i32>
    async { a().await }
}

fn main() {}