about summary refs log tree commit diff
path: root/src/libcore
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2016-10-19 08:00:03 +0300
committerGitHub <noreply@github.com>2016-10-19 08:00:03 +0300
commit3d57d42f13a2148ecbc3686f367643ebe4b841af (patch)
tree61bf21ad43252f2c0ca0599c756767d946bb2cee /src/libcore
parentad241dfa65616a9c065809d7b46af70821b1cb50 (diff)
parenta29b50303325cab60a6e4db0cbba434b2fe243a2 (diff)
downloadrust-3d57d42f13a2148ecbc3686f367643ebe4b841af.tar.gz
rust-3d57d42f13a2148ecbc3686f367643ebe4b841af.zip
Rollup merge of #37240 - jethrogb:typeid_doc, r=sfackler
Add stable example to TypeId

The old example is still available at [Any::get_type_id](https://doc.rust-lang.org/std/any/trait.Any.html#examples)
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() {