Skip to content

Conversation

@benodiwal
Copy link
Contributor

@benodiwal benodiwal commented Dec 7, 2025

Closes #21196

Screenshot 2025-12-08 at 4 42 49 AM Screenshot 2025-12-08 at 4 43 55 AM

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 7, 2025
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.

I don't want to use trait_ref() as it will print the hir-ty representation but I prefer the hir-def one, is there a reason you don't use target_trait as I suggested on the issue?

@benodiwal
Copy link
Contributor Author

benodiwal commented Dec 8, 2025

I don't want to use trait_ref() as it will print the hir-ty representation but I prefer the hir-def one, is there a reason you don't use target_trait as I suggested on the issue?

Thanks! I initially used trait_ref() as it was the obvious high-level API with an existing HirDisplay impl. But you're right that target_trait is better here since it uses the hir-def representation rather than going through hir-ty type resolution which is more appropriate for display purposes and consistent with the rest of the function. There is not any sepcific reason I used this approach, I just thought you have suggested one way to do it and its not rigid.
I have updated it now!

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 Dec 8, 2025
Merged via the queue into rust-lang:master with commit e1b11fe Dec 8, 2025
15 checks passed
@rustbot rustbot removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Dec 8, 2025
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.

Impl displaying does not show trait generic args

3 participants