@@ -71,63 +71,63 @@ LL | let _ = await bar()?;
7171 | ^^^^^^^^^^^^ help: `await` is a postfix operation: `bar()?.await`
7272
7373error: incorrect use of `await`
74- --> $DIR/incorrect-syntax-suggestions.rs:68 :14
74+ --> $DIR/incorrect-syntax-suggestions.rs:69 :14
7575 |
7676LL | let _ = (await bar())?;
7777 | ^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
7878
7979error: incorrect use of `await`
80- --> $DIR/incorrect-syntax-suggestions.rs:73 :24
80+ --> $DIR/incorrect-syntax-suggestions.rs:74 :24
8181 |
8282LL | let _ = bar().await();
8383 | ^^ help: `await` is not a method call, remove the parentheses
8484
8585error: incorrect use of `await`
86- --> $DIR/incorrect-syntax-suggestions.rs:78 :24
86+ --> $DIR/incorrect-syntax-suggestions.rs:79 :24
8787 |
8888LL | let _ = bar().await()?;
8989 | ^^ help: `await` is not a method call, remove the parentheses
9090
9191error: incorrect use of `await`
92- --> $DIR/incorrect-syntax-suggestions.rs:106 :13
92+ --> $DIR/incorrect-syntax-suggestions.rs:107 :13
9393 |
9494LL | let _ = await!(bar());
9595 | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
9696
9797error: incorrect use of `await`
98- --> $DIR/incorrect-syntax-suggestions.rs:110 :13
98+ --> $DIR/incorrect-syntax-suggestions.rs:111 :13
9999 |
100100LL | let _ = await!(bar())?;
101101 | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
102102
103103error: incorrect use of `await`
104- --> $DIR/incorrect-syntax-suggestions.rs:115 :17
104+ --> $DIR/incorrect-syntax-suggestions.rs:116 :17
105105 |
106106LL | let _ = await!(bar())?;
107107 | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
108108
109109error: incorrect use of `await`
110- --> $DIR/incorrect-syntax-suggestions.rs:123 :17
110+ --> $DIR/incorrect-syntax-suggestions.rs:124 :17
111111 |
112112LL | let _ = await!(bar())?;
113113 | ^^^^^^^^^^^^^ help: `await` is a postfix operation: `bar().await`
114114
115115error: expected expression, found `=>`
116- --> $DIR/incorrect-syntax-suggestions.rs:131 :25
116+ --> $DIR/incorrect-syntax-suggestions.rs:132 :25
117117 |
118118LL | match await { await => () }
119119 | ----- ^^ expected expression
120120 | |
121121 | while parsing this incorrect await expression
122122
123123error: incorrect use of `await`
124- --> $DIR/incorrect-syntax-suggestions.rs:131 :11
124+ --> $DIR/incorrect-syntax-suggestions.rs:132 :11
125125 |
126126LL | match await { await => () }
127127 | ^^^^^^^^^^^^^^^^^^^^^ help: `await` is a postfix operation: `{ await => () }.await`
128128
129129error: expected one of `.`, `?`, `{`, or an operator, found `}`
130- --> $DIR/incorrect-syntax-suggestions.rs:134 :1
130+ --> $DIR/incorrect-syntax-suggestions.rs:135 :1
131131 |
132132LL | match await { await => () }
133133 | ----- - expected one of `.`, `?`, `{`, or an operator
@@ -162,71 +162,71 @@ LL | let _ = await bar()?;
162162 | ^^^^^^^^^^^^ only allowed inside `async` functions and blocks
163163
164164error[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
166166 |
167167LL | fn foo12() -> Result<(), ()> {
168168 | ----- this is not `async`
169169LL | let _ = (await bar())?;
170170 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
171171
172172error[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
174174 |
175175LL | fn foo13() -> Result<(), ()> {
176176 | ----- this is not `async`
177177LL | let _ = bar().await();
178178 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
179179
180180error[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
182182 |
183183LL | fn foo14() -> Result<(), ()> {
184184 | ----- this is not `async`
185185LL | let _ = bar().await()?;
186186 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
187187
188188error[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
190190 |
191191LL | fn foo15() -> Result<(), ()> {
192192 | ----- this is not `async`
193193LL | let _ = bar().await;
194194 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
195195
196196error[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
198198 |
199199LL | fn foo16() -> Result<(), ()> {
200200 | ----- this is not `async`
201201LL | let _ = bar().await?;
202202 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
203203
204204error[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
206206 |
207207LL | fn foo() -> Result<(), ()> {
208208 | --- this is not `async`
209209LL | let _ = bar().await?;
210210 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
211211
212212error[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
214214 |
215215LL | let foo = || {
216216 | -- this is not `async`
217217LL | let _ = bar().await?;
218218 | ^^^^^^^^^^^ only allowed inside `async` functions and blocks
219219
220220error[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
222222 |
223223LL | fn foo() -> Result<(), ()> {
224224 | --- this is not `async`
225225LL | let _ = await!(bar())?;
226226 | ^^^^^^^^^^^^^ only allowed inside `async` functions and blocks
227227
228228error[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
230230 |
231231LL | let foo = || {
232232 | -- this is not `async`
@@ -242,7 +242,16 @@ LL | let _ = await bar()?;
242242 = help: the trait `std::ops::Try` is not implemented for `impl std::future::Future`
243243 = note: required by `std::ops::Try::into_result`
244244
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
246255
247256Some errors have detailed explanations: E0277, E0728.
248257For more information about an error, try `rustc --explain E0277`.
0 commit comments