Skip to content

Commit bc3e97a

Browse files
authored
Rollup merge of rust-lang#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
2 parents d24c66f + 57d33b1 commit bc3e97a

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
@@ -814,7 +814,7 @@ pub fn get_features(span_handler: &Handler, krate_attrs: &[ast::Attribute],
814814
}
815815

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

src/libsyntax/parse/literal.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ impl LitKind {
134134
let (kind, symbol, suffix) = match *self {
135135
LitKind::Str(symbol, ast::StrStyle::Cooked) => {
136136
// Don't re-intern unless the escaped string is different.
137-
let s = &symbol.as_str();
137+
let s: &str = &symbol.as_str();
138138
let escaped = s.escape_default().to_string();
139139
let symbol = if escaped == *s { symbol } else { Symbol::intern(&escaped) };
140140
(token::Str, symbol, None)

src/libsyntax_pos/symbol.rs

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

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

0 commit comments

Comments
 (0)