Skip to content

Commit 2404232

Browse files
committed
Remove the unneeded Sized bound on TypeId creation
This bound is probably unintentional and is unnecessarily constricting.
1 parent 6539cb4 commit 2404232

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libcore/intrinsics.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ extern "rust-intrinsic" {
200200
/// Gets an identifier which is globally unique to the specified type. This
201201
/// function will return the same value for a type regardless of whichever
202202
/// crate it is invoked in.
203-
pub fn type_id<T: 'static>() -> TypeId;
204-
203+
pub fn type_id<T: ?Sized + 'static>() -> TypeId;
205204

206205
/// Create a value initialized to zero.
207206
///
@@ -552,8 +551,9 @@ pub struct TypeId {
552551

553552
impl TypeId {
554553
/// Returns the `TypeId` of the type this generic function has been instantiated with
555-
pub fn of<T: 'static>() -> TypeId {
554+
pub fn of<T: ?Sized + 'static>() -> TypeId {
556555
unsafe { type_id::<T>() }
557556
}
557+
558558
pub fn hash(&self) -> u64 { self.t }
559559
}

0 commit comments

Comments
 (0)