diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-04-06 18:42:59 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-04-06 18:42:59 +0200 |
| commit | dbc2941c15db37bc4da07ae1df52045efe0f85c9 (patch) | |
| tree | d99385f4402611c3606f127d45f26367ba462532 | |
| parent | 08ab38a7036da7a014afc899c5a741e967f45a49 (diff) | |
| parent | 279f35ce50a7d8b0232a9fd994598ad786470d3f (diff) | |
| download | rust-dbc2941c15db37bc4da07ae1df52045efe0f85c9.tar.gz rust-dbc2941c15db37bc4da07ae1df52045efe0f85c9.zip | |
Rollup merge of #109980 - xfix:derive-string-partialeq, r=scottmcm
Derive String's PartialEq implementation
| -rw-r--r-- | library/alloc/src/string.rs | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/library/alloc/src/string.rs b/library/alloc/src/string.rs index c7e7ed3e95e..c1cd3c74ab6 100644 --- a/library/alloc/src/string.rs +++ b/library/alloc/src/string.rs @@ -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 { @@ -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")] |
