improve the way we deal with ambiguity errors #103911
Labels
A-diagnostics
Area: Messages for errors, warnings, and lints
C-cleanup
Category: PRs that clean code up or issues documenting cleanup.
E-hard
Call for participation: Hard difficulty. Experience needed to fix: A lot.
E-mentor
Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
right now we report each ambiguity error separately, sprinkling in a bunch of
self.is_tainted_by_errors()
and friends in there to deduplicate errors.This can often cause us to emit less useful errors because the more relevant error happens later.
It also restricts us in the suggestions we can emit.
This happens in
fn report_fulfillment_errors
:rust/compiler/rustc_trait_selection/src/traits/error_reporting/mod.rs
Lines 453 to 457 in ce1a7e4
I think ideally what we should do is:
CodeAmbiguity
errors and merge them by their annotated inference variable1.String
here" in this example.cc @estebank @jackh726
Open to review/help out if somebody wants to experiment with this. I won't be able to spend too much time on this though, so it's probably pretty difficult without prior experience with this code.
Footnotes
This is currently computed ad-hoc in
maybe_report_ambiguity
and should be moved into a separate function. ↩The text was updated successfully, but these errors were encountered: