Skip to content

Commit 3d57d42

Browse files
authored
Rollup merge of rust-lang#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)
2 parents ad241df + a29b503 commit 3d57d42

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/libcore/any.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -351,12 +351,10 @@ impl TypeId {
351351
/// # Examples
352352
///
353353
/// ```
354-
/// #![feature(get_type_id)]
355-
///
356354
/// use std::any::{Any, TypeId};
357355
///
358-
/// fn is_string(s: &Any) -> bool {
359-
/// TypeId::of::<String>() == s.get_type_id()
356+
/// fn is_string<T: ?Sized + Any>(_s: &T) -> bool {
357+
/// TypeId::of::<String>() == TypeId::of::<T>()
360358
/// }
361359
///
362360
/// fn main() {

0 commit comments

Comments
 (0)