]> git.lizzy.rs Git - rust.git/commitdiff
Add stable example to TypeId
authorJethro Beekman <jethro@fortanix.com>
Tue, 18 Oct 2016 00:49:07 +0000 (17:49 -0700)
committerJethro Beekman <jethro@fortanix.com>
Tue, 18 Oct 2016 00:49:07 +0000 (17:49 -0700)
src/libcore/any.rs

index f7edcb998a927328a8c33dadeea5841fc43ac5c8..eb0636e8576beb147e3c4f3823cd7e5b2cb09b46 100644 (file)
@@ -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() {