We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents accc6e7 + 940d48e commit 5bf5d6dCopy full SHA for 5bf5d6d
src/libcore/any.rs
@@ -445,6 +445,15 @@ impl TypeId {
445
///
446
/// The current implementation uses the same infrastructure as compiler
447
/// diagnostics and debuginfo, but this is not guaranteed.
448
+///
449
+/// # Example
450
451
+/// ```rust
452
+/// assert_eq!(
453
+/// std::any::type_name::<Option<String>>(),
454
+/// "core::option::Option<alloc::string::String>",
455
+/// );
456
+/// ```
457
#[stable(feature = "type_name", since = "1.38.0")]
458
#[rustc_const_unstable(feature = "const_type_name")]
459
pub const fn type_name<T: ?Sized>() -> &'static str {
0 commit comments