@@ -71,63 +71,63 @@ LL | let _ = await bar()?;
71
71
| ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
72
72
73
73
error: incorrect use of `await`
74
- --> $DIR/incorrect-syntax-suggestions.rs:68 :14
74
+ --> $DIR/incorrect-syntax-suggestions.rs:69 :14
75
75
|
76
76
LL | let _ = (await bar())?;
77
77
| ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
78
78
79
79
error: incorrect use of `await`
80
- --> $DIR/incorrect-syntax-suggestions.rs:73 :24
80
+ --> $DIR/incorrect-syntax-suggestions.rs:74 :24
81
81
|
82
82
LL | let _ = bar().await();
83
83
| ^^ help: `await` is not a method call, remove the parentheses
84
84
85
85
error: incorrect use of `await`
86
- --> $DIR/incorrect-syntax-suggestions.rs:78 :24
86
+ --> $DIR/incorrect-syntax-suggestions.rs:79 :24
87
87
|
88
88
LL | let _ = bar().await()?;
89
89
| ^^ help: `await` is not a method call, remove the parentheses
90
90
91
91
error: incorrect use of `await`
92
- --> $DIR/incorrect-syntax-suggestions.rs:106 :13
92
+ --> $DIR/incorrect-syntax-suggestions.rs:107 :13
93
93
|
94
94
LL | let _ = await!(bar());
95
95
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
96
96
97
97
error: incorrect use of `await`
98
- --> $DIR/incorrect-syntax-suggestions.rs:110 :13
98
+ --> $DIR/incorrect-syntax-suggestions.rs:111 :13
99
99
|
100
100
LL | let _ = await!(bar())?;
101
101
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
102
102
103
103
error: incorrect use of `await`
104
- --> $DIR/incorrect-syntax-suggestions.rs:115 :17
104
+ --> $DIR/incorrect-syntax-suggestions.rs:116 :17
105
105
|
106
106
LL | let _ = await!(bar())?;
107
107
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
108
108
109
109
error: incorrect use of `await`
110
- --> $DIR/incorrect-syntax-suggestions.rs:123 :17
110
+ --> $DIR/incorrect-syntax-suggestions.rs:124 :17
111
111
|
112
112
LL | let _ = await!(bar())?;
113
113
| ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
114
114
115
115
error: expected expression, found `=>`
116
- --> $DIR/incorrect-syntax-suggestions.rs:131 :25
116
+ --> $DIR/incorrect-syntax-suggestions.rs:132 :25
117
117
|
118
118
LL | match await { await => () }
119
119
| ----- ^^ expected expression
120
120
| |
121
121
| while parsing this incorrect await expression
122
122
123
123
error: incorrect use of `await`
124
- --> $DIR/incorrect-syntax-suggestions.rs:131 :11
124
+ --> $DIR/incorrect-syntax-suggestions.rs:132 :11
125
125
|
126
126
LL | match await { await => () }
127
127
| ^^^^^^^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ await => () }.await`
128
128
129
129
error: expected one of `.`, `?`, `{`, or an operator, found `}`
130
- --> $DIR/incorrect-syntax-suggestions.rs:134 :1
130
+ --> $DIR/incorrect-syntax-suggestions.rs:135 :1
131
131
|
132
132
LL | match await { await => () }
133
133
| ----- - expected one of `.`, `?`, `{`, or an operator
@@ -162,71 +162,71 @@ LL | let _ = await bar()?;
162
162
| ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
163
163
164
164
error[E0728]: `await` is only allowed inside `async` functions and blocks
165
- --> $DIR/incorrect-syntax-suggestions.rs:68 :14
165
+ --> $DIR/incorrect-syntax-suggestions.rs:69 :14
166
166
|
167
167
LL | fn foo12() -> Result<(), ()> {
168
168
| ----- this is not `async`
169
169
LL | let _ = (await bar())?;
170
170
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
171
171
172
172
error[E0728]: `await` is only allowed inside `async` functions and blocks
173
- --> $DIR/incorrect-syntax-suggestions.rs:73 :13
173
+ --> $DIR/incorrect-syntax-suggestions.rs:74 :13
174
174
|
175
175
LL | fn foo13() -> Result<(), ()> {
176
176
| ----- this is not `async`
177
177
LL | let _ = bar().await();
178
178
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
179
179
180
180
error[E0728]: `await` is only allowed inside `async` functions and blocks
181
- --> $DIR/incorrect-syntax-suggestions.rs:78 :13
181
+ --> $DIR/incorrect-syntax-suggestions.rs:79 :13
182
182
|
183
183
LL | fn foo14() -> Result<(), ()> {
184
184
| ----- this is not `async`
185
185
LL | let _ = bar().await()?;
186
186
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
187
187
188
188
error[E0728]: `await` is only allowed inside `async` functions and blocks
189
- --> $DIR/incorrect-syntax-suggestions.rs:83 :13
189
+ --> $DIR/incorrect-syntax-suggestions.rs:84 :13
190
190
|
191
191
LL | fn foo15() -> Result<(), ()> {
192
192
| ----- this is not `async`
193
193
LL | let _ = bar().await;
194
194
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
195
195
196
196
error[E0728]: `await` is only allowed inside `async` functions and blocks
197
- --> $DIR/incorrect-syntax-suggestions.rs:87 :13
197
+ --> $DIR/incorrect-syntax-suggestions.rs:88 :13
198
198
|
199
199
LL | fn foo16() -> Result<(), ()> {
200
200
| ----- this is not `async`
201
201
LL | let _ = bar().await?;
202
202
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
203
203
204
204
error[E0728]: `await` is only allowed inside `async` functions and blocks
205
- --> $DIR/incorrect-syntax-suggestions.rs:92 :17
205
+ --> $DIR/incorrect-syntax-suggestions.rs:93 :17
206
206
|
207
207
LL | fn foo() -> Result<(), ()> {
208
208
| --- this is not `async`
209
209
LL | let _ = bar().await?;
210
210
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
211
211
212
212
error[E0728]: `await` is only allowed inside `async` functions and blocks
213
- --> $DIR/incorrect-syntax-suggestions.rs:99 :17
213
+ --> $DIR/incorrect-syntax-suggestions.rs:100 :17
214
214
|
215
215
LL | let foo = || {
216
216
| -- this is not `async`
217
217
LL | let _ = bar().await?;
218
218
| ^^^^^^^^^^^ only allowed inside `async` functions and blocks
219
219
220
220
error[E0728]: `await` is only allowed inside `async` functions and blocks
221
- --> $DIR/incorrect-syntax-suggestions.rs:115 :17
221
+ --> $DIR/incorrect-syntax-suggestions.rs:116 :17
222
222
|
223
223
LL | fn foo() -> Result<(), ()> {
224
224
| --- this is not `async`
225
225
LL | let _ = await!(bar())?;
226
226
| ^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
227
227
228
228
error[E0728]: `await` is only allowed inside `async` functions and blocks
229
- --> $DIR/incorrect-syntax-suggestions.rs:123 :17
229
+ --> $DIR/incorrect-syntax-suggestions.rs:124 :17
230
230
|
231
231
LL | let foo = || {
232
232
| -- this is not `async`
@@ -242,7 +242,16 @@ LL | let _ = await bar()?;
242
242
= help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
243
243
= note: required by `std::ops::Try::into_result`
244
244
245
- error: aborting due to 35 previous errors
245
+ error[E0277]: the `?` operator can only be applied to values that implement `std::ops::Try`
246
+ --> $DIR/incorrect-syntax-suggestions.rs:63:19
247
+ |
248
+ LL | let _ = await bar()?;
249
+ | ^^^^^^ the `?` operator cannot be applied to type `impl std::future::Future`
250
+ |
251
+ = help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
252
+ = note: required by `std::ops::Try::into_result`
253
+
254
+ error: aborting due to 36 previous errors
246
255
247
256
Some errors have detailed explanations: E0277, E0728.
248
257
For more information about an error, try `rustc --explain E0277`.
0 commit comments