|
1 | | -use crate::cmp::Ordering; |
2 | | -use crate::hash::{Hash, Hasher}; |
3 | | -use crate::marker::{Destruct, StructuralPartialEq}; |
| 1 | +use crate::marker::Destruct; |
4 | 2 | use crate::mem::MaybeDangling; |
5 | 3 | use crate::ops::{Deref, DerefMut, DerefPure}; |
6 | 4 | use crate::ptr; |
@@ -155,7 +153,7 @@ use crate::ptr; |
155 | 153 | /// [`MaybeUninit`]: crate::mem::MaybeUninit |
156 | 154 | #[stable(feature = "manually_drop", since = "1.20.0")] |
157 | 155 | #[lang = "manually_drop"] |
158 | | -#[derive(Copy, Clone, Debug, Default)] |
| 156 | +#[derive(Clone, Copy, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Hash)] |
159 | 157 | #[repr(transparent)] |
160 | 158 | #[rustc_pub_transparent] |
161 | 159 | pub struct ManuallyDrop<T: ?Sized> { |
@@ -289,37 +287,3 @@ impl<T: ?Sized> const DerefMut for ManuallyDrop<T> { |
289 | 287 |
|
290 | 288 | #[unstable(feature = "deref_pure_trait", issue = "87121")] |
291 | 289 | unsafe impl<T: ?Sized> DerefPure for ManuallyDrop<T> {} |
292 | | - |
293 | | -#[stable(feature = "manually_drop", since = "1.20.0")] |
294 | | -impl<T: ?Sized + Eq> Eq for ManuallyDrop<T> {} |
295 | | - |
296 | | -#[stable(feature = "manually_drop", since = "1.20.0")] |
297 | | -impl<T: ?Sized + PartialEq> PartialEq for ManuallyDrop<T> { |
298 | | - fn eq(&self, other: &Self) -> bool { |
299 | | - self.value.as_ref().eq(other.value.as_ref()) |
300 | | - } |
301 | | -} |
302 | | - |
303 | | -#[stable(feature = "manually_drop", since = "1.20.0")] |
304 | | -impl<T: ?Sized> StructuralPartialEq for ManuallyDrop<T> {} |
305 | | - |
306 | | -#[stable(feature = "manually_drop", since = "1.20.0")] |
307 | | -impl<T: ?Sized + Ord> Ord for ManuallyDrop<T> { |
308 | | - fn cmp(&self, other: &Self) -> Ordering { |
309 | | - self.value.as_ref().cmp(other.value.as_ref()) |
310 | | - } |
311 | | -} |
312 | | - |
313 | | -#[stable(feature = "manually_drop", since = "1.20.0")] |
314 | | -impl<T: ?Sized + PartialOrd> PartialOrd for ManuallyDrop<T> { |
315 | | - fn partial_cmp(&self, other: &Self) -> Option<Ordering> { |
316 | | - self.value.as_ref().partial_cmp(other.value.as_ref()) |
317 | | - } |
318 | | -} |
319 | | - |
320 | | -#[stable(feature = "manually_drop", since = "1.20.0")] |
321 | | -impl<T: ?Sized + Hash> Hash for ManuallyDrop<T> { |
322 | | - fn hash<H: Hasher>(&self, state: &mut H) { |
323 | | - self.value.as_ref().hash(state); |
324 | | - } |
325 | | -} |
0 commit comments