use fmt;
use intrinsics;
-use marker::Reflect;
///////////////////////////////////////////////////////////////////////////////
// Any trait
///
/// [mod]: index.html
#[stable(feature = "rust1", since = "1.0.0")]
-pub trait Any: Reflect + 'static {
+pub trait Any: 'static {
/// Gets the `TypeId` of `self`.
///
/// # Examples
}
#[stable(feature = "rust1", since = "1.0.0")]
-impl<T: Reflect + 'static + ?Sized > Any for T {
+impl<T: 'static + ?Sized > Any for T {
fn get_type_id(&self) -> TypeId { TypeId::of::<T>() }
}
/// # Examples
///
/// ```
- /// #![feature(get_type_id)]
- ///
/// use std::any::{Any, TypeId};
///
- /// fn is_string(s: &Any) -> bool {
- /// TypeId::of::<String>() == s.get_type_id()
+ /// fn is_string<T: ?Sized + Any>(_s: &T) -> bool {
+ /// TypeId::of::<String>() == TypeId::of::<T>()
/// }
///
/// fn main() {
/// }
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
- pub fn of<T: ?Sized + Reflect + 'static>() -> TypeId {
+ pub fn of<T: ?Sized + 'static>() -> TypeId {
TypeId {
t: unsafe { intrinsics::type_id::<T>() },
}