diff --git a/library/core/src/any.rs b/library/core/src/any.rs index 79b6304958d51..f112d73cdca82 100644 --- a/library/core/src/any.rs +++ b/library/core/src/any.rs @@ -435,7 +435,7 @@ impl TypeId { /// assert_eq!(is_string(&"cookie monster".to_string()), true); /// ``` #[stable(feature = "rust1", since = "1.0.0")] - #[rustc_const_unstable(feature = "const_type_id", issue = "41875")] + #[rustc_const_stable(feature = "const_type_id", since = "1.45.0")] pub const fn of() -> TypeId { TypeId { t: intrinsics::type_id::() } } diff --git a/library/core/src/intrinsics.rs b/library/core/src/intrinsics.rs index 71780361d298e..b5dd92ecb1574 100644 --- a/library/core/src/intrinsics.rs +++ b/library/core/src/intrinsics.rs @@ -1024,7 +1024,7 @@ extern "rust-intrinsic" { /// /// The stabilized version of this intrinsic is /// [`std::any::TypeId::of`](../../std/any/struct.TypeId.html#method.of) - #[rustc_const_unstable(feature = "const_type_id", issue = "41875")] + #[rustc_const_stable(feature = "const_type_id", since = "1.45.0")] pub fn type_id() -> u64; /// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited: diff --git a/library/core/src/lib.rs b/library/core/src/lib.rs index e4b499a80229c..c2bd5d16088fd 100644 --- a/library/core/src/lib.rs +++ b/library/core/src/lib.rs @@ -145,7 +145,6 @@ #![feature(maybe_uninit_slice)] #![feature(external_doc)] #![feature(associated_type_bounds)] -#![feature(const_type_id)] #![feature(const_caller_location)] #![feature(slice_ptr_get)] #![feature(no_niche)] // rust-lang/rust#68303 diff --git a/src/test/ui/consts/const-typeid-of-rpass.rs b/src/test/ui/consts/const-typeid-of-rpass.rs index 225acb60ac44d..c49141050b20f 100644 --- a/src/test/ui/consts/const-typeid-of-rpass.rs +++ b/src/test/ui/consts/const-typeid-of-rpass.rs @@ -1,6 +1,5 @@ // run-pass #![feature(core_intrinsics)] -#![feature(const_type_id)] use std::any::TypeId; diff --git a/src/test/ui/consts/const-typeid-of.rs b/src/test/ui/consts/const-typeid-of.rs deleted file mode 100644 index 3829c481da837..0000000000000 --- a/src/test/ui/consts/const-typeid-of.rs +++ /dev/null @@ -1,8 +0,0 @@ -use std::any::TypeId; - -struct A; - -fn main() { - const A_ID: TypeId = TypeId::of::(); - //~^ ERROR `std::any::TypeId::of` is not yet stable as a const fn -} diff --git a/src/test/ui/consts/const-typeid-of.stderr b/src/test/ui/consts/const-typeid-of.stderr deleted file mode 100644 index 05347fbc81950..0000000000000 --- a/src/test/ui/consts/const-typeid-of.stderr +++ /dev/null @@ -1,10 +0,0 @@ -error: `std::any::TypeId::of` is not yet stable as a const fn - --> $DIR/const-typeid-of.rs:6:26 - | -LL | const A_ID: TypeId = TypeId::of::(); - | ^^^^^^^^^^^^^^^^^ - | - = help: add `#![feature(const_type_id)]` to the crate attributes to enable - -error: aborting due to previous error -