about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorJethro Beekman <jethro@fortanix.com>2016-10-17 17:49:07 -0700
committerJethro Beekman <jethro@fortanix.com>2016-10-17 17:49:07 -0700
commita29b50303325cab60a6e4db0cbba434b2fe243a2 (patch)
tree1a8e625f7f9f4c1e623e1e21506b4cdb19cd3d14 /src/libcore
parente0111758eb4f215db4ec26f809ef3edf5dfb66f5 (diff)
downloadrust-a29b50303325cab60a6e4db0cbba434b2fe243a2.tar.gz
rust-a29b50303325cab60a6e4db0cbba434b2fe243a2.zip
Add stable example to TypeId
Diffstat (limited to 'src/libcore')
-rw-r--r--src/libcore/any.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs
index f7edcb998a9..eb0636e8576 100644
--- a/src/libcore/any.rs
+++ b/src/libcore/any.rs
@@ -351,12 +351,10 @@ impl TypeId {
     /// # 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() {