diff options
Diffstat (limited to 'src/libcore/any.rs')
| -rw-r--r-- | src/libcore/any.rs | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs index fd5007ff415..c4b07d42e69 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -91,20 +91,15 @@ pub enum Void { } /// Every type with no non-`'static` references implements `Any`, so `Any` can /// be used as a trait object to emulate the effects dynamic typing. #[stable] -pub trait Any: AnyPrivate + 'static {} - -/// An inner trait to ensure that only this module can call `get_type_id()`. -pub trait AnyPrivate { +pub trait Any: 'static { /// Get the `TypeId` of `self` fn get_type_id(&self) -> TypeId; } -impl<T: 'static> AnyPrivate for T { +impl<T: 'static> Any for T { fn get_type_id(&self) -> TypeId { TypeId::of::<T>() } } -impl<T: 'static + AnyPrivate> Any for T {} - /////////////////////////////////////////////////////////////////////////////// // Extension methods for Any trait objects. // Implemented as three extension traits so that the methods can be generic. |
