mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Rollup merge of #109980 - xfix:derive-string-partialeq, r=scottmcm
Derive String's PartialEq implementation
This commit is contained in:
@@ -359,7 +359,7 @@
|
||||
/// [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 {
|
||||
@@ -2207,14 +2207,6 @@ fn strip_suffix_of(self, haystack: &'a str) -> Option<&'a str> {
|
||||
}
|
||||
}
|
||||
|
||||
#[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")]
|
||||
|
||||
Reference in New Issue
Block a user