]> git.lizzy.rs Git - rust.git/blob - src/test/ui/async-await/suggest-missing-await.stderr
Override rustc version in ui and mir-opt tests to get stable hashes
[rust.git] / src / test / ui / async-await / suggest-missing-await.stderr
1 error[E0308]: mismatched types
2   --> $DIR/suggest-missing-await.rs:12:14
3    |
4 LL |     take_u32(x)
5    |              ^ expected `u32`, found opaque type
6    |
7 note: while checking the return type of the `async fn`
8   --> $DIR/suggest-missing-await.rs:5:24
9    |
10 LL | async fn make_u32() -> u32 {
11    |                        ^^^ checked the `Output` of this `async fn`, found opaque type
12    = note:     expected type `u32`
13            found opaque type `impl Future<Output = u32>`
14 help: consider `await`ing on the `Future`
15    |
16 LL |     take_u32(x.await)
17    |               ++++++
18
19 error[E0308]: mismatched types
20   --> $DIR/suggest-missing-await.rs:22:5
21    |
22 LL |     dummy()
23    |     ^^^^^^^ expected `()`, found opaque type
24    |
25 note: while checking the return type of the `async fn`
26   --> $DIR/suggest-missing-await.rs:18:18
27    |
28 LL | async fn dummy() {}
29    |                  ^ checked the `Output` of this `async fn`, found opaque type
30    = note: expected unit type `()`
31             found opaque type `impl Future<Output = ()>`
32 help: consider `await`ing on the `Future`
33    |
34 LL |     dummy().await
35    |            ++++++
36 help: consider using a semicolon here
37    |
38 LL |     dummy();
39    |            +
40
41 error[E0308]: `if` and `else` have incompatible types
42   --> $DIR/suggest-missing-await.rs:35:9
43    |
44 LL |       let _x = if true {
45    |  ______________-
46 LL | |         dummy()
47    | |         ------- expected because of this
48 LL | |
49 LL | |     } else {
50 LL | |         dummy().await
51    | |         ^^^^^^^^^^^^^ expected opaque type, found `()`
52 LL | |
53 LL | |     };
54    | |_____- `if` and `else` have incompatible types
55    |
56    = note:   expected type `impl Future<Output = ()>`
57            found unit type `()`
58 help: consider `await`ing on the `Future`
59    |
60 LL |         dummy().await
61    |                ++++++
62
63 error[E0308]: `match` arms have incompatible types
64   --> $DIR/suggest-missing-await.rs:45:14
65    |
66 LL |       let _x = match 0usize {
67    |  ______________-
68 LL | |         0 => dummy(),
69    | |              ------- this is found to be of type `impl Future<Output = ()>`
70 LL | |         1 => dummy(),
71    | |              ------- this is found to be of type `impl Future<Output = ()>`
72 LL | |         2 => dummy().await,
73    | |              ^^^^^^^^^^^^^ expected opaque type, found `()`
74 LL | |
75 LL | |     };
76    | |_____- `match` arms have incompatible types
77    |
78 note: while checking the return type of the `async fn`
79   --> $DIR/suggest-missing-await.rs:18:18
80    |
81 LL | async fn dummy() {}
82    |                  ^ checked the `Output` of this `async fn`, expected opaque type
83    = note: expected opaque type `impl Future<Output = ()>`
84                 found unit type `()`
85 help: consider `await`ing on the `Future`
86    |
87 LL ~         0 => dummy().await,
88 LL ~         1 => dummy().await,
89    |
90
91 error[E0308]: mismatched types
92   --> $DIR/suggest-missing-await.rs:53:9
93    |
94 LL |         () => {}
95    |         ^^ expected opaque type, found `()`
96    |
97 note: while checking the return type of the `async fn`
98   --> $DIR/suggest-missing-await.rs:18:18
99    |
100 LL | async fn dummy() {}
101    |                  ^ checked the `Output` of this `async fn`, expected opaque type
102    = note: expected opaque type `impl Future<Output = ()>`
103                 found unit type `()`
104 help: consider `await`ing on the `Future`
105    |
106 LL |     let _x = match dummy().await {
107    |                           ++++++
108
109 error[E0308]: mismatched types
110   --> $DIR/suggest-missing-await.rs:67:9
111    |
112 LL |         Ok(_) => {}
113    |         ^^^^^ expected opaque type, found enum `Result`
114    |
115 note: while checking the return type of the `async fn`
116   --> $DIR/suggest-missing-await.rs:57:28
117    |
118 LL | async fn dummy_result() -> Result<(), ()> {
119    |                            ^^^^^^^^^^^^^^ checked the `Output` of this `async fn`, expected opaque type
120    = note: expected opaque type `impl Future<Output = Result<(), ()>>`
121                      found enum `Result<_, _>`
122 help: consider `await`ing on the `Future`
123    |
124 LL |     match dummy_result().await {
125    |                         ++++++
126
127 error[E0308]: mismatched types
128   --> $DIR/suggest-missing-await.rs:69:9
129    |
130 LL |         Err(_) => {}
131    |         ^^^^^^ expected opaque type, found enum `Result`
132    |
133 note: while checking the return type of the `async fn`
134   --> $DIR/suggest-missing-await.rs:57:28
135    |
136 LL | async fn dummy_result() -> Result<(), ()> {
137    |                            ^^^^^^^^^^^^^^ checked the `Output` of this `async fn`, expected opaque type
138    = note: expected opaque type `impl Future<Output = Result<(), ()>>`
139                      found enum `Result<_, _>`
140 help: consider `await`ing on the `Future`
141    |
142 LL |     match dummy_result().await {
143    |                         ++++++
144
145 error: aborting due to 7 previous errors
146
147 For more information about this error, try `rustc --explain E0308`.