Skip to content

fix: Make sense of the mess that were (are) different kind of generics in the solver#20586

Merged
ShoyuVanilla merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:placeholder-ns
Sep 3, 2025
Merged

fix: Make sense of the mess that were (are) different kind of generics in the solver#20586
ShoyuVanilla merged 1 commit into
rust-lang:masterfrom
ChayimFriedman2:placeholder-ns

Conversation

@ChayimFriedman2

Copy link
Copy Markdown
Contributor

To the extent possible.

Previously they were confused. Sometimes generic params were treated as Param and sometimes as Placeholder. A completely redundant (in the new solver) mapping of salsa::Id to ints to intern some info where we could just store it uninterned (not in Chalk though, for some weird reason).

Plus fix a cute bug in closure substitution that was caught by the assertions of Chalk but the next solver did not have such assertions. Do we need more assertions?

Should hopefully fix all failures in #20578.

…the solver

To the extent possible.

Previously they were confused. Sometimes generic params were treated as `Param` and sometimes as `Placeholder`. A completely redundant (in the new solver) mapping of salsa::Id to ints to intern some info where we could just store it uninterned (not in Chalk though, for some weird reason).

Plus fix a cute bug in closure substitution that was caught by the assertions of Chalk but the next solver did not have such assertions. Do we need more assertions?
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 2, 2025
0,
LocalTypeOrConstParamId::from_raw(la_arena::RawIdx::from_u32(0)),
&param,
)],

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

To the reviewer: I know what I did here is an indefensible crime. I sincerely apologize for the heart attack you will probably get by reading this. But the alternative was to wrap everything in Option and unwrap(), not more type safety and a lot more churn. I thought about this alone for about 15 minutes, then with a heavy heart voted for this option.

@jackh726

jackh726 commented Sep 2, 2025

Copy link
Copy Markdown
Member

Ah lovely, I ran into issues related to this (stemming from the display impl) when moving some stuff from chalk_ir to rustc_type_ir. So this should help with that.

@ShoyuVanilla ShoyuVanilla left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I believe this would be our best effort before making rust-analyzer completely free of chalk-ir 👍

@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Sep 3, 2025
Merged via the queue into rust-lang:master with commit a79e27b Sep 3, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 3, 2025
@ChayimFriedman2 ChayimFriedman2 deleted the placeholder-ns branch September 3, 2025 14:12
@lnicola

lnicola commented Oct 14, 2025

Copy link
Copy Markdown
Member

changelog fixup #20329

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.

5 participants