Skip to content

Conversation

jackh726
Copy link
Member

Each commit compiles, so these could land in parts if desired.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 13, 2025
@rust-cloud-vms rust-cloud-vms bot force-pushed the next-trait-solver-next branch 2 times, most recently from e0fa509 to d12e875 Compare August 14, 2025 16:04
hir_fmt_generic_arguments(f, parameters_to_write, self_)?;
write!(f, ">")?;
}
impl<'db> HirDisplay for crate::next_solver::Ty<'db> {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think you should replace the chalk ty display impl to converting to new solver ty then displaying it, to reduce duplicate code and maintenance efforts.

Copy link
Contributor

Choose a reason for hiding this comment

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

It will also help us better test the code.

Copy link
Member Author

Choose a reason for hiding this comment

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

I forwarded these impls. Associated type printing changes (only in tests). Had to add some salsa::attach calls, but otherwise no problems.

mut check_alias: impl FnMut(&Name, TraitRef<'db>, TypeAliasId) -> Option<R>,
) -> Option<R> {
let db = interner.db;
let mut search = |t: TraitRef<'db>| -> Option<R> {
Copy link
Contributor

Choose a reason for hiding this comment

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

You basically inlined all_super_trait_refs()? Why? Isn't it better to extract it to its own function?

Copy link
Member Author

Choose a reason for hiding this comment

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

Basically just moving things around here, not adding anything new.

IIRC, all_super_trait_refs does not work because of cycles, but I don't quite remember. Personally, I would not want to try to abstract this out in this PR since it's just moving things.


// we're _in_ the impl -- the binders get added back later. Correct,
// but it would be nice to make this more explicit
search(trait_ref.skip_binder())
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you not add the check for being inside an impl method?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't remember, I actually ported this months ago. I'll add a FIXME to come back to it, but don't want to figure this out here.

}))
}

pub(crate) fn associated_ty_item_bounds<'db>(
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not querify this? Although I see you haven't put the interner's one a query either. But at least reuse the code from DbInterner::item_bounds()?

Copy link
Member Author

Choose a reason for hiding this comment

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

The equivalent code from chalk_db was not querified either. I added a FIXME to reuse with explicit_item_bounds.

Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

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

Overall LGTM but I have some comments.

@rust-cloud-vms rust-cloud-vms bot force-pushed the next-trait-solver-next branch 3 times, most recently from 152571b to 77cd3dd Compare August 15, 2025 05:18
Copy link
Contributor

@ChayimFriedman2 ChayimFriedman2 left a comment

Choose a reason for hiding this comment

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

Thanks!

@ChayimFriedman2 ChayimFriedman2 added this pull request to the merge queue Aug 17, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Aug 17, 2025
@rust-cloud-vms rust-cloud-vms bot force-pushed the next-trait-solver-next branch from 77cd3dd to 596a6bf Compare August 17, 2025 16:04
@jackh726
Copy link
Member Author

Rebased - the test from #20462 had its output change (associated type printing in tests)

@ShoyuVanilla ShoyuVanilla enabled auto-merge August 17, 2025 16:12
@ShoyuVanilla ShoyuVanilla added this pull request to the merge queue Aug 17, 2025
Merged via the queue into rust-lang:master with commit 80bc952 Aug 17, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 17, 2025
@jackh726 jackh726 deleted the next-trait-solver-next branch August 17, 2025 22:31
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.

4 participants