diff options
| author | Trevor Gross <tmgross@umich.edu> | 2023-07-04 04:23:18 -0400 |
|---|---|---|
| committer | Trevor Gross <tmgross@umich.edu> | 2023-07-04 05:02:00 -0400 |
| commit | a635bf7a3ba121b20993ed3f24300d2b81f7e5c1 (patch) | |
| tree | 81056463c6578d56bfb022d0007fd8fcc2c5cb9e /library/alloc | |
| parent | 3c9a7491c2e2f54fa0ea59246c798017fcb8ce3f (diff) | |
| download | rust-a635bf7a3ba121b20993ed3f24300d2b81f7e5c1.tar.gz rust-a635bf7a3ba121b20993ed3f24300d2b81f7e5c1.zip | |
Revert "alloc: Allow comparing `Box`s over different allocators"
This reverts commit 001b081cc1bfd24657e2dccbd9c8289f9a9d67a5. This change was done as the above commit introduces a regression in type inference. Regression test located at `tests/ui/type-inference/issue-113283-alllocator-trait-eq.rs`
Diffstat (limited to 'library/alloc')
| -rw-r--r-- | library/alloc/src/boxed.rs | 35 |
1 files changed, 9 insertions, 26 deletions
diff --git a/library/alloc/src/boxed.rs b/library/alloc/src/boxed.rs index fa23367593d..8ef2bac9282 100644 --- a/library/alloc/src/boxed.rs +++ b/library/alloc/src/boxed.rs @@ -1319,56 +1319,39 @@ impl Clone for Box<str> { } #[stable(feature = "rust1", since = "1.0.0")] -impl<T, A1, A2> PartialEq<Box<T, A2>> for Box<T, A1> -where - T: ?Sized + PartialEq, - A1: Allocator, - A2: Allocator, -{ +impl<T: ?Sized + PartialEq, A: Allocator> PartialEq for Box<T, A> { #[inline] - fn eq(&self, other: &Box<T, A2>) -> bool { + fn eq(&self, other: &Self) -> bool { PartialEq::eq(&**self, &**other) } - #[inline] - fn ne(&self, other: &Box<T, A2>) -> bool { + fn ne(&self, other: &Self) -> bool { PartialEq::ne(&**self, &**other) } } - #[stable(feature = "rust1", since = "1.0.0")] -impl<T, A1, A2> PartialOrd<Box<T, A2>> for Box<T, A1> -where - T: ?Sized + PartialOrd, - A1: Allocator, - A2: Allocator, -{ +impl<T: ?Sized + PartialOrd, A: Allocator> PartialOrd for Box<T, A> { #[inline] - fn partial_cmp(&self, other: &Box<T, A2>) -> Option<Ordering> { + fn partial_cmp(&self, other: &Self) -> Option<Ordering> { PartialOrd::partial_cmp(&**self, &**other) } - #[inline] - fn lt(&self, other: &Box<T, A2>) -> bool { + fn lt(&self, other: &Self) -> bool { PartialOrd::lt(&**self, &**other) } - #[inline] - fn le(&self, other: &Box<T, A2>) -> bool { + fn le(&self, other: &Self) -> bool { PartialOrd::le(&**self, &**other) } - #[inline] - fn ge(&self, other: &Box<T, A2>) -> bool { + fn ge(&self, other: &Self) -> bool { PartialOrd::ge(&**self, &**other) } - #[inline] - fn gt(&self, other: &Box<T, A2>) -> bool { + fn gt(&self, other: &Self) -> bool { PartialOrd::gt(&**self, &**other) } } - #[stable(feature = "rust1", since = "1.0.0")] impl<T: ?Sized + Ord, A: Allocator> Ord for Box<T, A> { #[inline] |
