Skip to content

Commit 57d33b1

Browse files
committed
Remove custom PartialEq impls for LocalInternedString.
This is on-trend with the recent changes simplifying `LocalInternedString` and reducing its use.
1 parent 20cc752 commit 57d33b1

File tree

3 files changed

+2
-26
lines changed

3 files changed

+2
-26
lines changed

src/libsyntax/feature_gate/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -769,7 +769,7 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
769769
}
770770

771771
if let Some(allowed) = allow_features.as_ref() {
772-
if allowed.iter().find(|f| *f == name.as_str()).is_none() {
772+
if allowed.iter().find(|&f| f == &name.as_str() as &str).is_none() {
773773
span_err!(span_handler, mi.span(), E0725,
774774
"the feature `{}` is not in the list of allowed features",
775775
name);

src/libsyntax/parse/literal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl LitKind {
204204
let (kind, symbol, suffix) = match *self {
205205
LitKind::Str(symbol, ast::StrStyle::Cooked) => {
206206
// Don't re-intern unless the escaped string is different.
207-
let s = &symbol.as_str();
207+
let s: &str = &symbol.as_str();
208208
let escaped = s.escape_default().to_string();
209209
let symbol = if escaped == *s { symbol } else { Symbol::intern(&escaped) };
210210
(token::Str, symbol, None)

src/libsyntax_pos/symbol.rs

-24
Original file line numberDiff line numberDiff line change
@@ -1201,30 +1201,6 @@ impl<T: std::ops::Deref<Target = str>> std::cmp::PartialEq<T> for LocalInternedS
12011201
}
12021202
}
12031203

1204-
impl std::cmp::PartialEq<LocalInternedString> for str {
1205-
fn eq(&self, other: &LocalInternedString) -> bool {
1206-
self == other.string
1207-
}
1208-
}
1209-
1210-
impl<'a> std::cmp::PartialEq<LocalInternedString> for &'a str {
1211-
fn eq(&self, other: &LocalInternedString) -> bool {
1212-
*self == other.string
1213-
}
1214-
}
1215-
1216-
impl std::cmp::PartialEq<LocalInternedString> for String {
1217-
fn eq(&self, other: &LocalInternedString) -> bool {
1218-
self == other.string
1219-
}
1220-
}
1221-
1222-
impl<'a> std::cmp::PartialEq<LocalInternedString> for &'a String {
1223-
fn eq(&self, other: &LocalInternedString) -> bool {
1224-
*self == other.string
1225-
}
1226-
}
1227-
12281204
impl !Send for LocalInternedString {}
12291205
impl !Sync for LocalInternedString {}
12301206

0 commit comments

Comments
 (0)