rust/compiler
Matthias Krüger aa64f568b4
Rollup merge of #147768 - chenyukang:yukang-refactor-report-method-error, r=nnethercote
Code refactoring on hir report_no_match_method_error

While working on rust-lang/rust#147753, I found `report_no_match_method_error` now is too long for maintain, 1200 lines of code now:
57ef8d642d/compiler/rustc_hir_typeck/src/method/suggest.rs (L589-L1736)

this PR try to refactor it.

I tried my best to group most related code into same places, but the logic here is still very complex, there are some variables across different functions, maybe we need more work to make it better understand.

Maybe we could add a tidy check to avoid long spaghetti code.

r? `@nnethercote`
2025-10-22 07:12:10 +02:00
..
rustc Make llvm_enzyme a regular cargo feature 2025-09-15 15:31:56 +00:00
rustc_abi Rollup merge of #147134 - workingjubilee:remove-explicit-abialign-deref, r=Zalathar 2025-09-29 15:44:55 +10:00
rustc_arena some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_ast Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_ast_ir turn pointer width into an integer in target.json 2025-08-27 23:44:49 +02:00
rustc_ast_lowering Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_ast_passes Extract common logic for iterating over features 2025-10-02 21:43:14 +00:00
rustc_ast_pretty Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_attr_parsing Rollup merge of #147532 - JonathanBrouwer:cfg_attr2, r=jdonszelmann 2025-10-18 15:09:03 +02:00
rustc_baked_icu_data Use default locale fallback data 2025-08-28 09:48:54 +00:00
rustc_borrowck Auto merge of #144607 - camsteffen:impl-trait-header-option, r=lcnr 2025-10-18 00:08:18 +00:00
rustc_builtin_macros Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_codegen_cranelift Allow unsizing pattern types with pointer base 2025-10-21 11:22:51 +00:00
rustc_codegen_gcc remove broken link 2025-10-20 20:50:44 +00:00
rustc_codegen_llvm Auto merge of #147022 - Zalathar:no-args, r=wesleywiser 2025-10-22 00:21:08 +00:00
rustc_codegen_ssa Rollup merge of #142339 - oli-obk:not-null-pattern-types, r=BoxyUwU 2025-10-22 07:12:09 +02:00
rustc_const_eval Allow unsizing pattern types with pointer base 2025-10-21 11:22:51 +00:00
rustc_data_structures Rollup merge of #147716 - zhetaicheleba:master, r=jdonszelmann 2025-10-15 23:41:05 +02:00
rustc_driver compiler: Add Windows resources to rustc-main and rustc_driver 2025-09-05 14:06:31 -04:00
rustc_driver_impl Remove current code for embedding command-line args in PDB 2025-10-18 12:24:40 +11:00
rustc_error_codes Rollup merge of #146585 - hkBst:indexing-1, r=jdonszelmann 2025-10-02 10:27:49 +02:00
rustc_error_messages Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_errors fix: Use untrimmed line numbers for trimmed suggestions 2025-10-19 23:58:04 +08:00
rustc_expand Rollup merge of #147438 - reddevilmidzy:rename-non-inline-module-in-msg, r=fee1-dead 2025-10-18 23:54:44 +02:00
rustc_feature Extract common logic for iterating over features 2025-10-02 21:43:14 +00:00
rustc_fluent_macro some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_fs_util Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_graphviz some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_hashes some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_hir Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_hir_analysis Allow unsizing pattern types with pointer base 2025-10-21 11:22:51 +00:00
rustc_hir_id rustc_hir_id: Add a comment explaining why the crate exists 2025-08-20 15:04:00 -07:00
rustc_hir_pretty Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_hir_typeck add UnsatisfiedPredicate type alias 2025-10-22 09:51:58 +08:00
rustc_incremental Do not GC the current active incremental session directory 2025-10-20 02:39:55 +00:00
rustc_index Rollup merge of #147751 - nnethercote:bit_set-Word, r=Zalathar 2025-10-16 19:35:27 +02:00
rustc_index_macros Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_infer rename select_where_possible and select_all_or_error 2025-10-07 23:02:23 +01:00
rustc_interface Remove current code for embedding command-line args in PDB 2025-10-18 12:24:40 +11:00
rustc_lexer Fix a crash/mislex when more than one frontmatter closing possibility is considered 2025-09-22 15:10:41 -04:00
rustc_lint Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_lint_defs remove useless #![deny]s 2025-10-19 19:48:21 +02:00
rustc_llvm Remove current code for embedding command-line args in PDB 2025-10-18 12:24:40 +11:00
rustc_log Restrict sysroot crate imports to those defined in this repo. 2025-10-15 13:17:25 +01:00
rustc_macros use declarative macro for #[derive(TryFromU32)] 2025-10-06 14:54:38 +00:00
rustc_metadata Auto merge of #147695 - cjgillot:deduce-param-freeze, r=tmiasko 2025-10-18 12:37:45 +00:00
rustc_middle Rollup merge of #142339 - oli-obk:not-null-pattern-types, r=BoxyUwU 2025-10-22 07:12:09 +02:00
rustc_mir_build Fix ICE in pattern matching with generic const array length errors 2025-10-16 19:15:32 +08:00
rustc_mir_dataflow make move unwrap_binder! a move subpath 2025-10-11 22:51:40 -07:00
rustc_mir_transform Allow unsizing pattern types with pointer base 2025-10-21 11:22:51 +00:00
rustc_monomorphize Allow unsizing pattern types with pointer base 2025-10-21 11:22:51 +00:00
rustc_next_trait_solver Auto merge of #146725 - lcnr:eager-instantiate-binder, r=BoxyUwU 2025-10-21 21:09:46 +00:00
rustc_parse Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_parse_format Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_passes Rollup merge of #138679 - Shunpoco:issue-125323, r=oli-obk 2025-10-18 23:54:43 +02:00
rustc_pattern_analysis Rename various "concrete opaque type" terminology to say "hidden type" 2025-09-27 22:58:02 +01:00
rustc_privacy Split impl_(opt_)trait_ref 2025-10-17 08:36:34 -05:00
rustc_proc_macro Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_public Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_public_bridge Rollup merge of #147800 - makai410:rp-cache-obj, r=celinval 2025-10-21 12:20:56 +11:00
rustc_query_impl fixup limit handling code 2025-09-08 15:07:12 -07:00
rustc_query_system Auto merge of #147508 - nnethercote:TaskDeps-improvements, r=saethlin 2025-10-17 04:47:43 +00:00
rustc_resolve Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_sanitizers Split impl_(opt_)trait_ref 2025-10-17 08:36:34 -05:00
rustc_serialize Revert introduction of [workspace.dependencies]. 2025-09-02 19:12:54 +10:00
rustc_session Auto merge of #147022 - Zalathar:no-args, r=wesleywiser 2025-10-22 00:21:08 +00:00
rustc_span Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_symbol_mangling Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_target Rollup merge of #147454 - ferrocene:hoverbear/panic-abort-uwtables-qnx, r=wesleywiser 2025-10-18 08:08:37 +02:00
rustc_thread_pool some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_trait_selection Rollup merge of #142339 - oli-obk:not-null-pattern-types, r=BoxyUwU 2025-10-22 07:12:09 +02:00
rustc_traits Auto merge of #146096 - adwinwhite:handle_normalization_overflow_in_mono1, r=saethlin 2025-10-13 00:20:10 +00:00
rustc_transmute prefer to use repeat_n over repeat and take 2025-10-09 01:24:55 +08:00
rustc_ty_utils Add not-null pointer patterns to pattern types 2025-10-21 11:22:51 +00:00
rustc_type_ir Rollup merge of #142339 - oli-obk:not-null-pattern-types, r=BoxyUwU 2025-10-22 07:12:09 +02:00
rustc_type_ir_macros some cleanups in compiler 2025-10-12 08:08:30 +00:00
rustc_windows_rc [win] Use find-msvc-tools instead of cc to find the linker and rc on Windows 2025-09-19 12:00:30 -07:00