Skip to content

fix: give impl_trait_with_diagnostics a cycle result#22923

Merged
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
shulaoda:07-26-fix_give_impl_trait_with_diagnostics_a_cycle_result
Jul 26, 2026
Merged

fix: give impl_trait_with_diagnostics a cycle result#22923
ChayimFriedman2 merged 1 commit into
rust-lang:masterfrom
shulaoda:07-26-fix_give_impl_trait_with_diagnostics_a_cycle_result

Conversation

@shulaoda

Copy link
Copy Markdown
Contributor

Closes #22795

impl Self::Self makes the impl's trait ref depend on its own self type, and salsa panics because impl_trait_with_diagnostics declares no cycle result.

None is the natural recovery value here: the query already returns Option, and no resolvable trait ref is exactly what a self-referential impl has.

🤖 AI-assisted: understanding the issue, locating the cause, and writing the test.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2026
Comment thread crates/ide/src/syntax_highlighting/tests.rs Outdated
Comment thread crates/hir-ty/src/lower.rs
@shulaoda
shulaoda force-pushed the 07-26-fix_give_impl_trait_with_diagnostics_a_cycle_result branch from 5daa7a0 to 320e379 Compare July 26, 2026 16:35
@shulaoda
shulaoda requested a review from ChayimFriedman2 July 26, 2026 16:37

@ChayimFriedman2 ChayimFriedman2 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ChayimFriedman2
ChayimFriedman2 added this pull request to the merge queue Jul 26, 2026
Merged via the queue into rust-lang:master with commit 12c3381 Jul 26, 2026
18 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

panic: dependency graph cycle when querying impl_trait_with_diagnostics

3 participants