-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-intrinsicsArea: IntrinsicsArea: IntrinsicsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-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.
Description
In a similar spirit to #61533, it would be nice if the Any trait contained an auto implemented method akin to:
fn type_name(&self) -> &'static str
{
std::any::type_name::<T>()
}
This way it would be a lot easier print and surface errors like accidentally trying to cast Box<T>
to T
because &Box<T>
is also &Any
.
mcmasn-amzn
Metadata
Metadata
Assignees
Labels
A-intrinsicsArea: IntrinsicsArea: IntrinsicsC-feature-requestCategory: A feature request, i.e: not implemented / a PR.Category: A feature request, i.e: not implemented / a PR.T-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.