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 Add some comments. 2021-11-19 07:52:59 +11:00
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 re-format with new rustfmt 2021-11-30 13:08:41 -05:00
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 add rustc option for using LLVM stack smash protection 2021-11-22 20:06:22 +01:00
rustc_error_codes Clarify and tidy up explanation of E0038 2021-11-30 09:25:17 -08:00
rustc_errors Rollup merge of #91394 - Mark-Simulacrum:bump-stage0, r=pietroalbini 2021-12-02 15:52:03 +01:00
rustc_expand Remove redundant [..]s 2021-12-09 00:01:29 +01:00
rustc_feature update accepted feature gate 2021-12-11 00:12:57 +00:00
rustc_fs_util
rustc_graphviz Remove redundant [..]s 2021-12-09 00:01:29 +01:00
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 Auto merge of #90491 - Mark-Simulacrum:push-pred-faster, r=matthewjasper 2021-11-24 15:51:46 +00:00
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 Auto merge of #91393 - Julian-Wollersberger:lexer_optimization, r=petrochenkov 2021-12-03 13:20:14 +00:00
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 Auto merge of #91284 - t6:freebsd-riscv64, r=Amanieu 2021-12-06 03:51:05 +00:00
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 Evaluate inline const pat early and report error if too generic 2021-12-05 21:38:37 +00:00
rustc_mir_dataflow Auto merge of #91475 - ecstatic-morse:mir-pass-manager3, r=oli-obk 2021-12-05 03:41:18 +00:00
rustc_mir_transform use try_normalize_erasing_regions in RevealAllVisitor 2021-12-13 23:13:24 +01:00
rustc_monomorphize Rollup merge of #90701 - michaelwoerister:more-artifact-sizes, r=davidtwco 2021-11-09 19:00:45 +01:00
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 replace dynamic library module with libloading 2021-12-06 12:03:47 -05:00
rustc_privacy Take a LocalDefId in expect_*item. 2021-11-28 21:09:45 +01:00
rustc_query_impl Query modifier 2021-12-12 12:35:00 +08:00
rustc_query_system std: Stabilize the thread_local_const_init feature 2021-11-29 07:23:46 -08:00
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 Remove redundant [..]s 2021-12-09 00:01:29 +01:00
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 Revert "Add rustc lint, warning when iterating over hashmaps" 2021-10-28 11:01:42 -04:00
rustc_target asm: Allow using r9 (ARM) and x18 (AArch64) if they are not reserved by 2021-12-10 00:51:39 +00:00
rustc_trait_selection review comment: change wording of suggestion 2021-12-13 17:09:16 +00:00
rustc_traits Reduce boilerplate around infallible folders 2021-12-02 16:14:16 +00:00
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