Revert "Remove the unneeded Sized bound on TypeId creation"
This reverts commit 240423236906a2df976edd6065bbc595711b83c0. Conflicts: src/libcore/intrinsics.rs
This commit is contained in:
parent
56a9e2fcd5
commit
24ccb34266
@ -42,9 +42,6 @@
|
||||
#![experimental]
|
||||
#![allow(missing_docs)]
|
||||
|
||||
#[cfg(not(stage0))]
|
||||
use marker::Sized;
|
||||
|
||||
pub type GlueFn = extern "Rust" fn(*const i8);
|
||||
|
||||
#[lang="ty_desc"]
|
||||
@ -203,9 +200,6 @@ 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.
|
||||
#[cfg(not(stage0))]
|
||||
pub fn type_id<T: ?Sized + 'static>() -> TypeId;
|
||||
#[cfg(stage0)]
|
||||
pub fn type_id<T: 'static>() -> TypeId;
|
||||
|
||||
/// Create a value initialized to zero.
|
||||
@ -556,19 +550,9 @@ pub struct TypeId {
|
||||
}
|
||||
|
||||
impl TypeId {
|
||||
/// Returns the `TypeId` of the type this generic function has been
|
||||
/// instantiated with
|
||||
#[cfg(stage0)]
|
||||
/// Returns the `TypeId` of the type this generic function has been instantiated with
|
||||
pub fn of<T: 'static>() -> TypeId {
|
||||
unsafe { type_id::<T>() }
|
||||
}
|
||||
|
||||
/// Returns the `TypeId` of the type this generic function has been
|
||||
/// instantiated with
|
||||
#[cfg(not(stage0))]
|
||||
pub fn of<T: ?Sized + 'static>() -> TypeId {
|
||||
unsafe { type_id::<T>() }
|
||||
}
|
||||
|
||||
pub fn hash(&self) -> u64 { self.t }
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user