about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJoshua Liebow-Feeser <joshlf@users.noreply.github.com>2021-09-13 12:39:45 -0700
committerGitHub <noreply@github.com>2021-09-13 12:39:45 -0700
commit1053a5bb0ff9f781cc1fa0385ce699fe49ee2ad2 (patch)
treeb503067ce962d88d073eb2216809c6a8889102ab
parentb0ee4951f0289aa31e54b101c5706f220315e197 (diff)
downloadrust-1053a5bb0ff9f781cc1fa0385ce699fe49ee2ad2.tar.gz
rust-1053a5bb0ff9f781cc1fa0385ce699fe49ee2ad2.zip
`Wrapping<T>` has the same layout and ABI as `T`
-rw-r--r--library/core/src/num/wrapping.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/library/core/src/num/wrapping.rs b/library/core/src/num/wrapping.rs
index be6d70320d4..b078cdf5479 100644
--- a/library/core/src/num/wrapping.rs
+++ b/library/core/src/num/wrapping.rs
@@ -32,6 +32,10 @@ use crate::ops::{Shl, ShlAssign, Shr, ShrAssign, Sub, SubAssign};
 ///
 /// 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)]