Skip to content

Commit

Permalink
Rollup merge of rust-lang#109980 - xfix:derive-string-partialeq, r=sc…
Browse files Browse the repository at this point in the history
…ottmcm

Derive String's PartialEq implementation
  • Loading branch information
matthiaskrgr authored Apr 6, 2023
2 parents f99b844 + 279f35c commit 0ca7ecc
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions library/alloc/src/string.rs
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ use crate::vec::Vec;
/// [Deref]: core::ops::Deref "ops::Deref"
/// [`Deref`]: core::ops::Deref "ops::Deref"
/// [`as_str()`]: String::as_str
#[derive(PartialOrd, Eq, Ord)]
#[derive(PartialEq, PartialOrd, Eq, Ord)]
#[stable(feature = "rust1", since = "1.0.0")]
#[cfg_attr(not(test), lang = "String")]
pub struct String {
Expand Down Expand Up @@ -2207,14 +2207,6 @@ impl<'a, 'b> Pattern<'a> for &'b String {
}
}

#[stable(feature = "rust1", since = "1.0.0")]
impl PartialEq for String {
#[inline]
fn eq(&self, other: &String) -> bool {
PartialEq::eq(&self[..], &other[..])
}
}

macro_rules! impl_eq {
($lhs:ty, $rhs: ty) => {
#[stable(feature = "rust1", since = "1.0.0")]
Expand Down

0 comments on commit 0ca7ecc

Please sign in to comment.