rust/compiler
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
..
rustc
rustc_apfloat
rustc_arena
rustc_ast Auto merge of #90207 - BoxyUwU:stabilise_cg_defaults, r=lcnr 2021-12-12 14:24:23 +00:00
rustc_ast_lowering Fix rebase and clippy tests 2021-12-13 17:09:16 +00:00
rustc_ast_passes Auto merge of #90207 - BoxyUwU:stabilise_cg_defaults, r=lcnr 2021-12-12 14:24:23 +00:00
rustc_ast_pretty Rollup merge of #91625 - est31:remove_indexes, r=oli-obk 2021-12-10 22:40:36 +01:00
rustc_attr
rustc_borrowck Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk" 2021-12-12 12:34:46 +08:00
rustc_builtin_macros Remove automatic rustfix of asm! to llvm_asm! 2021-12-12 11:20:03 +00:00
rustc_codegen_cranelift Remove invalid doc links. 2021-12-13 20:40:17 +00:00
rustc_codegen_gcc Stabilize asm! and global_asm! 2021-12-12 11:20:03 +00:00
rustc_codegen_llvm Rollup merge of #91855 - xfix:const_cstr_unchecked, r=dtolnay 2021-12-13 18:15:17 +01:00
rustc_codegen_ssa Auto merge of #91569 - erikdesjardins:vt-align, r=nikic 2021-12-13 04:29:20 +00:00
rustc_const_eval Remove in_band_lifetimes from rustc_const_eval 2021-12-13 22:39:00 -05:00
rustc_data_structures Auto merge of #91549 - fee1-dead:const_env, r=spastorino 2021-12-12 22:15:32 +00:00
rustc_driver
rustc_error_codes
rustc_errors
rustc_expand
rustc_feature update accepted feature gate 2021-12-11 00:12:57 +00:00
rustc_fs_util
rustc_graphviz
rustc_hir Rollup merge of #90939 - estebank:wg-af-polish, r=tmandry 2021-12-15 01:28:04 +01:00
rustc_hir_pretty Keep info on pre-desugaring expression for better "incorrect .await" suggestion 2021-12-13 17:09:16 +00:00
rustc_incremental Rollup merge of #91625 - est31:remove_indexes, r=oli-obk 2021-12-10 22:40:36 +01:00
rustc_index
rustc_infer Instead of checking for exact bounds, try to prove them 2021-12-13 00:48:46 -05:00
rustc_interface Auto merge of #90716 - euclio:libloading, r=cjgillot 2021-12-12 17:28:52 +00:00
rustc_lexer
rustc_lint Rollup merge of #90939 - estebank:wg-af-polish, r=tmandry 2021-12-15 01:28:04 +01:00
rustc_lint_defs Disable asm lint example tests since they only work on x86_64 2021-12-14 11:48:28 +00:00
rustc_llvm
rustc_macros Query modifier 2021-12-12 12:35:00 +08:00
rustc_metadata Auto merge of #90716 - euclio:libloading, r=cjgillot 2021-12-12 17:28:52 +00:00
rustc_middle Rollup merge of #90939 - estebank:wg-af-polish, r=tmandry 2021-12-15 01:28:04 +01:00
rustc_mir_build
rustc_mir_dataflow
rustc_mir_transform use try_normalize_erasing_regions in RevealAllVisitor 2021-12-13 23:13:24 +01:00
rustc_monomorphize
rustc_parse Fix rebase and clippy tests 2021-12-13 17:09:16 +00:00
rustc_parse_format
rustc_passes Rollup merge of #90939 - estebank:wg-af-polish, r=tmandry 2021-12-15 01:28:04 +01:00
rustc_plugin_impl
rustc_privacy
rustc_query_impl Query modifier 2021-12-12 12:35:00 +08:00
rustc_query_system
rustc_resolve Rollup merge of #91764 - cjgillot:elide-anyway, r=jackh726 2021-12-11 23:31:52 +01:00
rustc_save_analysis Keep info on pre-desugaring expression for better "incorrect .await" suggestion 2021-12-13 17:09:16 +00:00
rustc_serialize Auto merge of #91626 - klensy:json-less-alloc, r=petrochenkov 2021-12-13 07:30:38 +00:00
rustc_session
rustc_span Auto merge of #91660 - llogiq:make-a-hash-of-def-ids, r=nnethercote 2021-12-14 01:39:01 +00:00
rustc_symbol_mangling
rustc_target
rustc_trait_selection review comment: change wording of suggestion 2021-12-13 17:09:16 +00:00
rustc_traits
rustc_ty_utils Revert "Auto merge of #91491 - spastorino:revert-91354, r=oli-obk" 2021-12-12 12:34:46 +08:00
rustc_type_ir Fix HashStable implementation on InferTy 2021-12-13 20:36:17 -08:00
rustc_typeck Rollup merge of #90939 - estebank:wg-af-polish, r=tmandry 2021-12-15 01:28:04 +01:00