-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Intrinsic for type_name_of_id to power a better impl Debug for TypeId? #61533
Copy link
Copy link
Open
Labels
T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.needs-fcpThis change is insta-stable, or significant enough to need a team FCP to proceed.This change is insta-stable, or significant enough to need a team FCP to proceed.
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language teamRelevant to the language teamT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.needs-fcpThis change is insta-stable, or significant enough to need a team FCP to proceed.This change is insta-stable, or significant enough to need a team FCP to proceed.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently
TypeIds have uninformative derivedDebugimpls:This results in fairly poor Debug output for dynamic types like
anymap.I think it could be quite nice for debugging/logging/etc to allow printing the type name from a
TypeIdin the Debug impl. It would provide an out of the box improvement to debugging existing dynamic typing tools, and IIUC the contents of Debug impls in the standard library are not considered stable so there's neither a breaking change here nor a de facto stabilization of the type_name representation.I assume this would need to rely on some unstable intrinsic being exposed to get the type_name of an ID at run time, but I'm not really aware what would be needed.
Thoughts? cc @oli-obk as we had discussed this a bit on IRC.