diff options
| author | Frank Steffahn <fdsteffahn@gmail.com> | 2023-07-24 23:37:35 +0900 |
|---|---|---|
| committer | Frank Steffahn <fdsteffahn@gmail.com> | 2023-07-24 23:37:35 +0900 |
| commit | 3911a63b7777e19dad4043542f908018e70c0bdd (patch) | |
| tree | 9b5f69ccad5b41f15e24b95cd18c6d3762551edc /library/proc_macro | |
| parent | f475098ffdf43fbdf7765b90e60175572404e89a (diff) | |
| download | rust-3911a63b7777e19dad4043542f908018e70c0bdd.tar.gz rust-3911a63b7777e19dad4043542f908018e70c0bdd.zip | |
Hide `ToString` implementations that specialize the default ones
The status quo is highly confusing, since the overlap is not apparent, and specialization is not a feature of Rust. This addresses #87545; I'm not certain if it closes it, since that issue might also be trackign a *general* solution for hiding specializing impls automatically.
Diffstat (limited to 'library/proc_macro')
| -rw-r--r-- | library/proc_macro/src/lib.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/library/proc_macro/src/lib.rs b/library/proc_macro/src/lib.rs index 7fb0d989cdb..2c0d113dbc5 100644 --- a/library/proc_macro/src/lib.rs +++ b/library/proc_macro/src/lib.rs @@ -177,6 +177,7 @@ impl FromStr for TokenStream { // N.B., the bridge only provides `to_string`, implement `fmt::Display` // based on it (the reverse of the usual relationship between the two). +#[doc(hidden)] #[stable(feature = "proc_macro_lib", since = "1.15.0")] impl ToString for TokenStream { fn to_string(&self) -> String { @@ -738,6 +739,7 @@ impl From<Literal> for TokenTree { // N.B., the bridge only provides `to_string`, implement `fmt::Display` // based on it (the reverse of the usual relationship between the two). +#[doc(hidden)] #[stable(feature = "proc_macro_lib", since = "1.15.0")] impl ToString for TokenTree { fn to_string(&self) -> String { @@ -872,6 +874,7 @@ impl Group { // N.B., the bridge only provides `to_string`, implement `fmt::Display` // based on it (the reverse of the usual relationship between the two). +#[doc(hidden)] #[stable(feature = "proc_macro_lib", since = "1.15.0")] impl ToString for Group { fn to_string(&self) -> String { @@ -981,6 +984,7 @@ impl Punct { } } +#[doc(hidden)] #[stable(feature = "proc_macro_lib2", since = "1.29.0")] impl ToString for Punct { fn to_string(&self) -> String { @@ -1083,8 +1087,7 @@ impl Ident { } } -/// Converts the identifier to a string that should be losslessly convertible -/// back into the same identifier. +#[doc(hidden)] #[stable(feature = "proc_macro_lib2", since = "1.29.0")] impl ToString for Ident { fn to_string(&self) -> String { @@ -1423,6 +1426,7 @@ impl FromStr for Literal { } } +#[doc(hidden)] #[stable(feature = "proc_macro_lib2", since = "1.29.0")] impl ToString for Literal { fn to_string(&self) -> String { |
