-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
rust-lang/rust
#60066Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.disposition-mergeThis RFC is in PFCP or FCP with a disposition to merge it.This RFC is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this RFC.The final comment period is finished for this RFC.
Description
We have an intrinsic which returns a &'static str
naming a type but it's not exposed in a safe/stable manner anywhere: http://doc.rust-lang.org/std/intrinsics/fn.type_name.html
Something like this should suffice:
pub fn type_name<T: Reflect + ?Sized>() -> &'static str {
unsafe { std::intrinsics::type_name::<T>() }
}
ivan, ActuallyaDeviloper, Veedrac, kennytm, lucaskolstad and 25 moreObject905, CAD97, lovesegfault, LifeIsStrange, quininer and 3 moretorkleyy
Metadata
Metadata
Assignees
Labels
T-langRelevant to the language team, which will review and decide on the RFC.Relevant to the language team, which will review and decide on the RFC.T-libs-apiRelevant to the library API team, which will review and decide on the RFC.Relevant to the library API team, which will review and decide on the RFC.disposition-mergeThis RFC is in PFCP or FCP with a disposition to merge it.This RFC is in PFCP or FCP with a disposition to merge it.finished-final-comment-periodThe final comment period is finished for this RFC.The final comment period is finished for this RFC.