]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/suggest-missing-await.rs
Rollup merge of #71627 - ldm0:autoderefarg, r=Dylan-DPC
[rust.git] / src / test / ui / async-await / suggest-missing-await.rs
1 // edition:2018
2 // run-rustfix
3
4 fn take_u32(_x: u32) {}
5
6 async fn make_u32() -> u32 {
7     22
8 }
9
10 #[allow(unused)]
11 async fn suggest_await_in_async_fn() {
12     let x = make_u32();
13     take_u32(x)
14     //~^ ERROR mismatched types [E0308]
15     //~| HELP consider using `.await` here
16     //~| SUGGESTION x.await
17 }
18
19 async fn dummy() {}
20
21 #[allow(unused)]
22 async fn suggest_await_in_async_fn_return() {
23     dummy()
24     //~^ ERROR mismatched types [E0308]
25     //~| HELP try adding a semicolon
26     //~| HELP consider using `.await` here
27     //~| SUGGESTION dummy().await
28 }
29
30 fn main() {}