about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/any.rs3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs
index f7aef66942d..078091a9b54 100644
--- a/src/libcore/any.rs
+++ b/src/libcore/any.rs
@@ -468,7 +468,8 @@ impl TypeId {
 /// The current implementation uses the same infrastructure as compiler
 /// diagnostics and debuginfo, but this is not guaranteed.
 #[stable(feature = "type_name", since = "1.38.0")]
-pub fn type_name<T: ?Sized>() -> &'static str {
+#[rustc_const_unstable(feature = "const_type_name")]
+pub const fn type_name<T: ?Sized>() -> &'static str {
     #[cfg(bootstrap)]
     unsafe {
         intrinsics::type_name::<T>()