Skip to content

Commit

Permalink
Rollup merge of #68342 - lcnr:type_name_docs, r=Dylan-DPC
Browse files Browse the repository at this point in the history
improve type_name_of_val docs

suggested by @Globidev in #66359 (comment)
  • Loading branch information
Centril authored Jan 18, 2020
2 parents 6c94ceb + 6b7f3e5 commit e8819b6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
///
Expand Down

0 comments on commit e8819b6

Please sign in to comment.