Remove support for specializing ToString outside the standard library

This is the only trait specializable outside of the standard library.
Before stabilizing specialization we will probably want to remove
support for this. It was originally made specializable to allow a more
efficient ToString in libproc_macro back when this way the only way to
get any data out of a TokenStream. We now support getting individual
tokens, so proc macros no longer need to call it as often.
This commit is contained in:
bjorn3 2023-12-31 18:35:49 +00:00
parent 8e37e15183
commit b805f30542
5 changed files with 43 additions and 117 deletions

View file

@ -25,7 +25,6 @@
#![feature(hash_set_entry)]
#![feature(if_let_guard)]
#![feature(let_chains)]
#![feature(min_specialization)]
#![feature(negative_impls)]
#![feature(read_buf)]
#![feature(round_char_boundary)]

View file

@ -2471,13 +2471,6 @@ impl fmt::Display for Symbol {
}
}
// takes advantage of `str::to_string` specialization
impl ToString for Symbol {
fn to_string(&self) -> String {
self.as_str().to_string()
}
}
impl<CTX> HashStable<CTX> for Symbol {
#[inline]
fn hash_stable(&self, hcx: &mut CTX, hasher: &mut StableHasher) {