Skip to content

Commit

Permalink
stabilize const_type_id feature
Browse files Browse the repository at this point in the history
  • Loading branch information
KodrAus committed Jul 28, 2020
1 parent ac48e62 commit cac16c9
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 22 deletions.
2 changes: 1 addition & 1 deletion library/core/src/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: ?Sized + 'static>() -> TypeId {
TypeId { t: intrinsics::type_id::<T>() }
}
Expand Down
2 changes: 1 addition & 1 deletion library/core/src/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T: ?Sized + 'static>() -> u64;

/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
Expand Down
1 change: 0 additions & 1 deletion library/core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion src/test/ui/consts/const-typeid-of-rpass.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
// run-pass
#![feature(core_intrinsics)]
#![feature(const_type_id)]

use std::any::TypeId;

Expand Down
8 changes: 0 additions & 8 deletions src/test/ui/consts/const-typeid-of.rs

This file was deleted.

10 changes: 0 additions & 10 deletions src/test/ui/consts/const-typeid-of.stderr

This file was deleted.

0 comments on commit cac16c9

Please sign in to comment.