]> git.lizzy.rs Git - rust.git/blobdiff - src/libcore/any.rs
Added minor clarification to specification of realloc.
[rust.git] / src / libcore / any.rs
index 4afea12a362c89f04810544c1c4f46448f1a4d56..af02e84d3fa537f5c7fdb1469e4d45ba29364f33 100644 (file)
@@ -476,11 +476,15 @@ pub const fn type_name<T: ?Sized>() -> &'static str {
 ///
 /// This is intended for diagnostic use. The exact contents and format of the
 /// string are not specified, other than being a best-effort description of the
-/// type. For example, `type_name_of::<Option<String>>(None)` could return
+/// type. For example, `type_name_of_val::<Option<String>>(None)` could return
 /// `"Option<String>"` or `"std::option::Option<std::string::String>"`, but not
 /// `"foobar"`. In addition, the output may change between versions of the
 /// compiler.
 ///
+/// This function does not resolve trait objects,
+/// meaning that `type_name_of_val(&7u32 as &dyn Debug)`
+/// may return `"dyn Debug"`, but not `"u32"`.
+///
 /// The type name should not be considered a unique identifier of a type;
 /// multiple types may share the same type name.
 ///