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