Rollup merge of #65426 - nnethercote:rm-custom-LocalInternedString-PartialEq-impls, r=petrochenkov

Remove custom `PartialEq` impls for `LocalInternedString`.

This is on-trend with the recent changes simplifying
`LocalInternedString` and reducing its use.

r? @petrochenkov
This commit is contained in:
Mazdak Farrokhzad 2019-10-15 13:27:29 +02:00 committed by GitHub
commit bc3e97a277
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 2 additions and 26 deletions

View file

@ -814,7 +814,7 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
}
if let Some(allowed) = allow_features.as_ref() {
if allowed.iter().find(|f| *f == name.as_str()).is_none() {
if allowed.iter().find(|&f| f == &name.as_str() as &str).is_none() {
span_err!(span_handler, mi.span(), E0725,
"the feature `{}` is not in the list of allowed features",
name);

View file

@ -134,7 +134,7 @@ impl LitKind {
let (kind, symbol, suffix) = match *self {
LitKind::Str(symbol, ast::StrStyle::Cooked) => {
// Don't re-intern unless the escaped string is different.
let s = &symbol.as_str();
let s: &str = &symbol.as_str();
let escaped = s.escape_default().to_string();
let symbol = if escaped == *s { symbol } else { Symbol::intern(&escaped) };
(token::Str, symbol, None)

View file

@ -1202,30 +1202,6 @@ impl<T: std::ops::Deref<Target = str>> std::cmp::PartialEq<T> for LocalInternedS
}
}
impl std::cmp::PartialEq<LocalInternedString> for str {
fn eq(&self, other: &LocalInternedString) -> bool {
self == other.string
}
}
impl<'a> std::cmp::PartialEq<LocalInternedString> for &'a str {
fn eq(&self, other: &LocalInternedString) -> bool {
*self == other.string
}
}
impl std::cmp::PartialEq<LocalInternedString> for String {
fn eq(&self, other: &LocalInternedString) -> bool {
self == other.string
}
}
impl<'a> std::cmp::PartialEq<LocalInternedString> for &'a String {
fn eq(&self, other: &LocalInternedString) -> bool {
*self == other.string
}
}
impl !Send for LocalInternedString {}
impl !Sync for LocalInternedString {}