Skip to content

Commit

Permalink
Auto merge of rust-lang#105752 - chenyukang:yukang/refactor-method-er…
Browse files Browse the repository at this point in the history
…ror, r=compiler-errors

Refactoring report_method_error

While working on rust-lang#105732, I found it's hard to follow this long function,
so I tried to make it shorter.

It's not easy for code reviewing, since so many lines of code changes,
but only the positions are changed.

Generally, I extract two sub-methods from `report_method_error`:

https://github.com/rust-lang/rust/blob/397b66e77b279de5006facf87979f9ecff5c7f87/compiler/rustc_hir_typeck/src/method/suggest.rs#L117
to `note_candidates_on_method_error`

And this long block:
https://github.com/rust-lang/rust/blob/397b66e77b279de5006facf87979f9ecff5c7f87/compiler/rustc_hir_typeck/src/method/suggest.rs#L263

to `report_no_match_method_error`.

r? `@compiler-errors`
  • Loading branch information
bors committed Jan 3, 2023
2 parents ab10908 + 93e62a4 commit c757267
Showing 1 changed file with 913 additions and 908 deletions.
Loading

0 comments on commit c757267

Please sign in to comment.