Skip to content

Commit c9f1162

Browse files
committed
Rephrase the any::type_name docs a bit.
This attempts to be a little clearer (including in terminology) about the lack of guarantees that any::type_name provides.
1 parent ff4df04 commit c9f1162

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

src/libcore/any.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,14 @@ impl TypeId {
446446
/// # Note
447447
///
448448
/// This is intended for diagnostic use. The exact contents and format of the
449-
/// string are not specified, other than being a best-effort description of the
450-
/// type. For example, `type_name::<Option<String>>()` could return the
451-
/// `"Option<String>"` or `"std::option::Option<std::string::String>"`, but not
452-
/// `"foobar"`. In addition, the output may change between versions of the
453-
/// compiler.
449+
/// string retrned are not specified, other than being a best-effort description
450+
/// of the type. For example, amongst the strings
451+
/// that `type_name::<Option<String>>()` might map to are `"Option<String>"` and
452+
/// `"std::option::Option<std::string::String>"`.
454453
///
455-
/// The type name should not be considered a unique identifier of a type;
456-
/// multiple types may share the same type name.
454+
/// The returned string must not be considered to be a unique identifier of a
455+
/// type as multiple types may map to the same type name. In addition, the
456+
/// output may change between versions of the compiler.
457457
///
458458
/// The current implementation uses the same infrastructure as compiler
459459
/// diagnostics and debuginfo, but this is not guaranteed.

0 commit comments

Comments
 (0)