Wrapping<T> has the same layout and ABI as T

This commit is contained in:
Joshua Liebow-Feeser 2021-09-13 12:39:45 -07:00 committed by GitHub
parent b0ee4951f0
commit 1053a5bb0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -32,6 +32,10 @@
///
/// assert_eq!(u32::MAX, (zero - one).0);
/// ```
///
/// # Layout
///
/// `Wrapping<T>` is guaranteed to have the same layout and ABI as `T`.
#[stable(feature = "rust1", since = "1.0.0")]
#[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Default, Hash)]
#[repr(transparent)]