rust/compiler
Matthias Krüger b622552e10
Rollup merge of #93221 - alyssaverkade:fix-93093, r=wesleywiser
[borrowck] Fix help on mutating &self in async fns

Previously, when rustc was provided an async function that tried to
mutate through a shared reference to an implicit self (as shown in the
ui test), rustc would suggest modifying the parameter signature
to `&mut` + the fully qualified name of the ty (in the case of the repro
`S`). If a user modified their code to match the suggestion, the
compiler would not accept it.

This commit modifies the suggestion so that when rustc is provided the
ui test that is also attached in this commit, it suggests (correctly)
`&mut self`. We try to be careful about distinguishing between implicit
and explicit self annotations, since the latter seem to be handled
correctly already.

This is my first PR here so I'm pretty sure I probably missed something/could use better terminology. I also didn't try to make the match exhaustive since implicit self is the only real special case that I need to handle (that I'm aware of), and I'm pretty sure there's a cleaner way to do this so any advice would be greatly appreciated! (I'm also not terribly confident about how I wrote the ui tests)

here is your cc as requested `@compiler-errors`

This is an attempt to fix #93093
2022-02-02 19:34:02 +01:00
..
rustc remove unused jemallocator crate 2022-01-28 16:56:05 +01:00
rustc_apfloat
rustc_arena Clarify ArenaAllocatable's second parameter. 2022-01-28 07:37:10 +11:00
rustc_ast
rustc_ast_lowering add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_ast_passes add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_ast_pretty Allow any line to have at least 60 chars 2022-01-31 10:56:57 -08:00
rustc_attr
rustc_borrowck Rollup merge of #93221 - alyssaverkade:fix-93093, r=wesleywiser 2022-02-02 19:34:02 +01:00
rustc_builtin_macros add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_codegen_cranelift
rustc_codegen_gcc
rustc_codegen_llvm Auto merge of #93154 - michaelwoerister:fix-generic-closure-and-generator-debuginfo, r=wesleywiser 2022-02-02 12:37:28 +00:00
rustc_codegen_ssa Auto merge of #93154 - michaelwoerister:fix-generic-closure-and-generator-debuginfo, r=wesleywiser 2022-02-02 12:37:28 +00:00
rustc_const_eval add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_data_structures Rollup merge of #92528 - tmiasko:combine-commutative, r=michaelwoerister 2022-02-02 19:34:01 +01:00
rustc_driver add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_error_codes Rollup merge of #88205 - danii:e0772, r=GuillaumeGomez 2022-01-29 14:46:29 +01:00
rustc_errors add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_expand add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_feature add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_fs_util
rustc_graphviz
rustc_hir Auto merge of #93285 - JulianKnodt:const_eq_2, r=oli-obk 2022-02-01 23:18:01 +00:00
rustc_hir_pretty try apply rustc_pass_by_value to Span 2022-01-27 11:29:41 +01:00
rustc_incremental add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_index implement lint for suspicious auto trait impls 2022-02-01 09:55:19 +01:00
rustc_infer Auto merge of #93285 - JulianKnodt:const_eq_2, r=oli-obk 2022-02-01 23:18:01 +00:00
rustc_interface Auto merge of #93466 - cjgillot:query-dead, r=nagisa 2022-02-02 02:29:32 +00:00
rustc_lexer
rustc_lint Rollup merge of #93290 - lcnr:same_type, r=jackh726 2022-02-01 16:08:05 +01:00
rustc_lint_defs implement lint for suspicious auto trait impls 2022-02-01 09:55:19 +01:00
rustc_llvm
rustc_log
rustc_macros
rustc_metadata add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_middle Rollup merge of #93560 - steffahn:a_typo, r=petrochenkov 2022-02-02 07:11:09 +01:00
rustc_mir_build add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_mir_dataflow
rustc_mir_transform Rollup merge of #93290 - lcnr:same_type, r=jackh726 2022-02-01 16:08:05 +01:00
rustc_monomorphize add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_parse Rollup merge of #93019 - 5225225:uppercase-suffix, r=wesleywiser 2022-01-31 20:12:55 -08:00
rustc_parse_format
rustc_passes Auto merge of #93466 - cjgillot:query-dead, r=nagisa 2022-02-02 02:29:32 +00:00
rustc_plugin_impl
rustc_privacy add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_query_impl add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_query_system add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_resolve Detect :: -> : typo in type argument 2022-02-02 01:19:24 +00:00
rustc_save_analysis add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_serialize Remove two unnecessary transmutes from opaque Encoder and Decoder 2022-01-31 18:25:05 +01:00
rustc_session Add missing | between print options 2022-02-01 12:40:01 -08:00
rustc_span add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_symbol_mangling add a rustc::query_stability lint 2022-02-01 10:15:59 +01:00
rustc_target Rollup merge of #92021 - woodenarrow:br_single_fp_element, r=Mark-Simulacrum 2022-02-01 16:08:03 +01:00
rustc_trait_selection Auto merge of #93285 - JulianKnodt:const_eq_2, r=oli-obk 2022-02-01 23:18:01 +00:00
rustc_traits Remove generalization over projection 2022-01-28 00:25:36 +00:00
rustc_ty_utils remove TyS::same_type 2022-02-01 11:21:26 +01:00
rustc_type_ir
rustc_typeck Auto merge of #93285 - JulianKnodt:const_eq_2, r=oli-obk 2022-02-01 23:18:01 +00:00