Skip to content

merge ambiguity errors that blame the same inference variable - #159593

Open
Albab-Hasan wants to merge 1 commit into
rust-lang:mainfrom
Albab-Hasan:merge-ambiguity-errors
Open

merge ambiguity errors that blame the same inference variable#159593
Albab-Hasan wants to merge 1 commit into
rust-lang:mainfrom
Albab-Hasan:merge-ambiguity-errors

Conversation

@Albab-Hasan

Copy link
Copy Markdown
Contributor

multiple FulfillmentErrorCode::Ambiguity obligations on the same inference variable only ever reported the first. the rest got dropped after set_tainted_by_errors fired. grouped them by sub-unification-table root and fold Trait/Projection predicates from the group into notes on the primary. uses the sub root not the raw TyVid so variables unified by a pending Coerce obligation correctly land in the same group.

fixes #103911

r? @lcnr

multiple `FulfillmentErrorCode::Ambiguity` obligations on the same
inference variable only ever reported the first — the rest got dropped
after `set_tainted_by_errors` fired. grouped them by sub-unification-table
root and fold Trait/Projection predicates from the group into notes on the
primary. uses the sub root not the raw TyVid so variables unified by a
pending Coerce obligation correctly land in the same group.

fixes rust-lang#103911
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver) labels Jul 20, 2026
@lcnr

lcnr commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

looks vaguely good to me, gonna reassign though as I don't have the capacity to properly review this rn

@rustbot reroll

@rustbot rustbot assigned jackh726 and unassigned lcnr Jul 20, 2026
@rust-log-analyzer

Copy link
Copy Markdown
Collaborator

The job x86_64-gnu-tools failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)
...............................F.................. (50/144)
.................................................. (100/144)
............................................       (144/144)

======== tests/rustdoc-gui/go-to-collapsed-elem.goml ========

[ERROR] line 40
    at `tests/rustdoc-gui/go-to-collapsed-elem.goml` line 21: Error: Node is either not clickable or not an Element: for command `click: "//*[@id='search']//a[@href='../test_docs/struct.Foo.html#method.must_use']"`
    at <file:///checkout/obj/build/x86_64-unknown-linux-gnu/test/rustdoc-gui/doc/test_docs/struct.Foo.html?search=t_use>


<= doc-ui tests done: 143 succeeded, 1 failed, 0 filtered out

Error: ()

@Albab-Hasan

Copy link
Copy Markdown
Contributor Author

@jackh726 i think this is causing the failure:

#157747

@lcnr lcnr closed this Jul 20, 2026
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 20, 2026
@lcnr lcnr reopened this Jul 20, 2026
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 20, 2026
@Albab-Hasan

Copy link
Copy Markdown
Contributor Author

@jackh726 hello, just wanted to follow up on the pr. sorry if this is bothering you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. WG-trait-system-refactor The Rustc Trait System Refactor Initiative (-Znext-solver)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

improve the way we deal with ambiguity errors

5 participants