File tree 1 file changed +5
-1
lines changed
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -476,11 +476,15 @@ pub const fn type_name<T: ?Sized>() -> &'static str {
476
476
///
477
477
/// This is intended for diagnostic use. The exact contents and format of the
478
478
/// string are not specified, other than being a best-effort description of the
479
- /// type. For example, `type_name_of ::<Option<String>>(None)` could return
479
+ /// type. For example, `type_name_of_val ::<Option<String>>(None)` could return
480
480
/// `"Option<String>"` or `"std::option::Option<std::string::String>"`, but not
481
481
/// `"foobar"`. In addition, the output may change between versions of the
482
482
/// compiler.
483
483
///
484
+ /// This function does not resolve trait objects,
485
+ /// meaning that `type_name_of_val(&7u32 as &dyn Debug)`
486
+ /// may return `"dyn Debug"`, but not `"u32"`.
487
+ ///
484
488
/// The type name should not be considered a unique identifier of a type;
485
489
/// multiple types may share the same type name.
486
490
///
You can’t perform that action at this time.
0 commit comments