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)
This commit is contained in:
Eduard-Mihai Burtescu 2016-10-19 08:00:03 +03:00 committed by GitHub
commit 3d57d42f13

View 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() {