granite-rust/compiler/rustc_middle/src
Matthias Krüger 272188eecd
Rollup merge of #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 #66731.
2021-12-15 01:28:04 +01:00
..
dep_graph Address review. 2021-10-20 18:51:15 +02:00
hir Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk" 2021-12-12 12:34:46 +08:00
infer Remap more env constness for queries 2021-12-12 12:35:00 +08:00
middle Remove unused root_parent. 2021-11-28 21:48:28 +01:00
mir Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk" 2021-12-12 12:34:46 +08:00
query Remap more env constness for queries 2021-12-12 12:35:00 +08:00
thir add a CastKind to Node::Cast 2021-09-09 01:32:03 +01:00
traits Keep info on pre-desugaring expression for better "incorrect .await" suggestion 2021-12-13 17:09:16 +00:00
ty Avoid cloning refcounted types during folding 2021-12-13 14:27:26 +00:00
util Use AddAssign impl 2021-11-09 23:47:36 +01:00
arena.rs Add some comments. 2021-11-19 07:52:59 +11:00
lib.rs Avoid cloning refcounted types during folding 2021-12-13 14:27:26 +00:00
lint.rs Simplify for loop desugar 2021-11-21 08:15:21 -06:00
macros.rs Rename TypeFolderFallible to FallibleTypeFolder 2021-12-02 16:14:18 +00:00
tests.rs mv compiler to compiler/ 2020-08-30 18:45:07 +03:00
thir.rs rename mir -> thir around abstract consts 2021-09-09 01:32:03 +01:00