We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 873b361 commit 4a3d41dCopy full SHA for 4a3d41d
src/libcore/any.rs
@@ -468,7 +468,8 @@ impl TypeId {
468
/// The current implementation uses the same infrastructure as compiler
469
/// diagnostics and debuginfo, but this is not guaranteed.
470
#[stable(feature = "type_name", since = "1.38.0")]
471
-pub fn type_name<T: ?Sized>() -> &'static str {
+#[rustc_const_unstable(feature = "const_type_name")]
472
+pub const fn type_name<T: ?Sized>() -> &'static str {
473
#[cfg(bootstrap)]
474
unsafe {
475
intrinsics::type_name::<T>()
0 commit comments