Skip to content

Commit dbc2941

Browse files
authored
Rollup merge of rust-lang#109980 - xfix:derive-string-partialeq, r=scottmcm
Derive String's PartialEq implementation
2 parents 08ab38a + 279f35c commit dbc2941

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

library/alloc/src/string.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ use crate::vec::Vec;
359359
/// [Deref]: core::ops::Deref "ops::Deref"
360360
/// [`Deref`]: core::ops::Deref "ops::Deref"
361361
/// [`as_str()`]: String::as_str
362-
#[derive(PartialOrd, Eq, Ord)]
362+
#[derive(PartialEq, PartialOrd, Eq, Ord)]
363363
#[stable(feature = "rust1", since = "1.0.0")]
364364
#[cfg_attr(not(test), lang = "String")]
365365
pub struct String {
@@ -2207,14 +2207,6 @@ impl<'a, 'b> Pattern<'a> for &'b String {
22072207
}
22082208
}
22092209

2210-
#[stable(feature = "rust1", since = "1.0.0")]
2211-
impl PartialEq for String {
2212-
#[inline]
2213-
fn eq(&self, other: &String) -> bool {
2214-
PartialEq::eq(&self[..], &other[..])
2215-
}
2216-
}
2217-
22182210
macro_rules! impl_eq {
22192211
($lhs:ty, $rhs: ty) => {
22202212
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)