Skip to content

Commit cac16c9

Browse files
committed
stabilize const_type_id feature
1 parent ac48e62 commit cac16c9

File tree

6 files changed

+2
-22
lines changed

6 files changed

+2
-22
lines changed

library/core/src/any.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ impl TypeId {
435435
/// assert_eq!(is_string(&"cookie monster".to_string()), true);
436436
/// ```
437437
#[stable(feature = "rust1", since = "1.0.0")]
438-
#[rustc_const_unstable(feature = "const_type_id", issue = "41875")]
438+
#[rustc_const_stable(feature = "const_type_id", since = "1.45.0")]
439439
pub const fn of<T: ?Sized + 'static>() -> TypeId {
440440
TypeId { t: intrinsics::type_id::<T>() }
441441
}

library/core/src/intrinsics.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1024,7 +1024,7 @@ extern "rust-intrinsic" {
10241024
///
10251025
/// The stabilized version of this intrinsic is
10261026
/// [`std::any::TypeId::of`](../../std/any/struct.TypeId.html#method.of)
1027-
#[rustc_const_unstable(feature = "const_type_id", issue = "41875")]
1027+
#[rustc_const_stable(feature = "const_type_id", since = "1.45.0")]
10281028
pub fn type_id<T: ?Sized + 'static>() -> u64;
10291029

10301030
/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:

library/core/src/lib.rs

-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,6 @@
145145
#![feature(maybe_uninit_slice)]
146146
#![feature(external_doc)]
147147
#![feature(associated_type_bounds)]
148-
#![feature(const_type_id)]
149148
#![feature(const_caller_location)]
150149
#![feature(slice_ptr_get)]
151150
#![feature(no_niche)] // rust-lang/rust#68303

src/test/ui/consts/const-typeid-of-rpass.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
// run-pass
22
#![feature(core_intrinsics)]
3-
#![feature(const_type_id)]
43

54
use std::any::TypeId;
65

src/test/ui/consts/const-typeid-of.rs

-8
This file was deleted.

src/test/ui/consts/const-typeid-of.stderr

-10
This file was deleted.

0 commit comments

Comments
 (0)