Commit 3642bcd
authored
Rollup merge of rust-lang#90939 - estebank:wg-af-polish, r=tmandry
Tweak errors coming from `for`-loop, `?` and `.await` desugaring
* Suggest removal of `.await` on non-`Future` expression
* Keep track of obligations introduced by desugaring
* Remove span pointing at method for obligation errors coming from desugaring
* Point at called local sync `fn` and suggest making it `async`
```
error[E0277]: `()` is not a future
--> $DIR/unnecessary-await.rs:9:10
|
LL | boo().await;
| -----^^^^^^ `()` is not a future
| |
| this call returns `()`
|
= help: the trait `Future` is not implemented for `()`
help: do not `.await` the expression
|
LL - boo().await;
LL + boo();
|
help: alternatively, consider making `fn boo` asynchronous
|
LL | async fn boo () {}
| +++++
```
Fix rust-lang#66731.1 file changed
+4
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
115 | 115 | | |
116 | 116 | | |
117 | 117 | | |
118 | | - | |
| 118 | + | |
119 | 119 | | |
120 | 120 | | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
124 | | - | |
125 | | - | |
126 | | - | |
| 124 | + | |
| 125 | + | |
127 | 126 | | |
128 | 127 | | |
129 | 128 | | |
| |||
226 | 225 | | |
227 | 226 | | |
228 | 227 | | |
229 | | - | |
230 | 228 | | |
231 | 229 | | |
232 | 230 | | |
| |||
238 | 236 | | |
239 | 237 | | |
240 | 238 | | |
241 | | - | |
242 | 239 | | |
243 | 240 | | |
244 | 241 | | |
| |||
252 | 249 | | |
253 | 250 | | |
254 | 251 | | |
255 | | - | |
256 | 252 | | |
257 | 253 | | |
258 | 254 | | |
| |||
264 | 260 | | |
265 | 261 | | |
266 | 262 | | |
267 | | - | |
268 | 263 | | |
269 | 264 | | |
270 | 265 | | |
| |||
277 | 272 | | |
278 | 273 | | |
279 | 274 | | |
280 | | - | |
281 | 275 | | |
282 | 276 | | |
283 | 277 | | |
| |||
290 | 284 | | |
291 | 285 | | |
292 | 286 | | |
293 | | - | |
294 | 287 | | |
295 | 288 | | |
296 | 289 | | |
| |||
301 | 294 | | |
302 | 295 | | |
303 | 296 | | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
| 297 | + | |
308 | 298 | | |
309 | 299 | | |
310 | 300 | | |
| |||
0 commit comments