diff options
| author | Laurence Tratt <laurie@tratt.net> | 2020-05-04 10:17:39 +0100 |
|---|---|---|
| committer | Laurence Tratt <laurie@tratt.net> | 2020-05-04 11:04:53 +0100 |
| commit | c9f1162a6ffc81adcb114a616899edad0f7d0750 (patch) | |
| tree | ca49ebfd9c21620accb5bc44f009abd14da55f6d | |
| parent | ff4df04799c406c8149a041c3163321758aac924 (diff) | |
| download | rust-c9f1162a6ffc81adcb114a616899edad0f7d0750.tar.gz rust-c9f1162a6ffc81adcb114a616899edad0f7d0750.zip | |
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.
| -rw-r--r-- | src/libcore/any.rs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/libcore/any.rs b/src/libcore/any.rs index 39df803bbea..67698e5409f 100644 --- a/src/libcore/any.rs +++ b/src/libcore/any.rs @@ -446,14 +446,14 @@ impl TypeId { /// # Note /// /// 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::<Option<String>>()` could return the -/// `"Option<String>"` or `"std::option::Option<std::string::String>"`, but not -/// `"foobar"`. In addition, the output may change between versions of the -/// compiler. +/// string retrned are not specified, other than being a best-effort description +/// of the type. For example, amongst the strings +/// that `type_name::<Option<String>>()` might map to are `"Option<String>"` and +/// `"std::option::Option<std::string::String>"`. /// -/// The type name should not be considered a unique identifier of a type; -/// multiple types may share the same type name. +/// The returned string must not be considered to be a unique identifier of a +/// type as multiple types may map to the same type name. In addition, the +/// output may change between versions of the compiler. /// /// The current implementation uses the same infrastructure as compiler /// diagnostics and debuginfo, but this is not guaranteed. |
