Closed
Description
(Originally discussed in #58140 (comment))
Right now a TraitRef
prints as <T as Trait<U>>
via "debug" ({:?}
) and Trait<U>
via "display" ({}
) - this is used all over rustc to indicate what printed form of the trait is desired.
However, it would be overall cleaner for "display" and "debug" printing to match (or even for fmt::Display
to not be implemented at all, perhaps?), and provide all the information that exists (i.e. including the Self
type).
We would then need a replacement for printing "just the trait path with its parameters", and I think we can have a method, .print_only_trait_path()
, that returns a wrapper which has the different formatting behavior.
Metadata
Metadata
Assignees
Labels
Category: PRs that clean code up or issues documenting cleanup.Call for participation: Medium difficulty. Experience needed to fix: Intermediate.Call for participation: This issue has a mentor. Use #t-compiler/help on Zulip for discussion.Relevant to the compiler team, which will review and decide on the PR/issue.