Skip to content

Commit

Permalink
Auto merge of #106607 - compiler-errors:be-more-accurate-abt-method-s…
Browse files Browse the repository at this point in the history
…uggestions, r=oli-obk

Consider return type when giving various method suggestions

1. Fix a bug in method probe where we weren't normalizing `xform_ret_ty` for non-`impl` method candidates. This shouldn't affect happy-path code, since we only use `xform_ret_ty` when probing methods for diagnostics (I think).
2. Pass the return type expectation down to `lookup_probe`/`probe_for_name` usages in diagnostics. Added a few UI tests to gate against bad suggestions.
3. Make a `FnCtxt::lookup_probe_for_diagnostic` which properly passes down `IsSuggestion(true)`. Should help suppress other weird notes in some corner cases.
  • Loading branch information
bors committed Jan 10, 2023
2 parents 6835235 + 3522af9 commit 5863e52
Showing 0 changed files with 0 additions and 0 deletions.

0 comments on commit 5863e52

Please sign in to comment.