Skip to content

Commit

Permalink
Remove the unneeded Sized bound on TypeId creation
Browse files Browse the repository at this point in the history
This bound is probably unintentional and is unnecessarily
constricting.
  • Loading branch information
reem committed Jan 6, 2015
1 parent 6539cb4 commit 2404232
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/libcore/intrinsics.rs
Expand Up @@ -200,8 +200,7 @@ extern "rust-intrinsic" {
/// Gets an identifier which is globally unique to the specified type. This
/// function will return the same value for a type regardless of whichever
/// crate it is invoked in.
pub fn type_id<T: 'static>() -> TypeId;

pub fn type_id<T: ?Sized + 'static>() -> TypeId;

/// Create a value initialized to zero.
///
Expand Down Expand Up @@ -552,8 +551,9 @@ pub struct TypeId {

impl TypeId {
/// Returns the `TypeId` of the type this generic function has been instantiated with
pub fn of<T: 'static>() -> TypeId {
pub fn of<T: ?Sized + 'static>() -> TypeId {
unsafe { type_id::<T>() }
}

pub fn hash(&self) -> u64 { self.t }
}

0 comments on commit 2404232

Please sign in to comment.