From 1053a5bb0ff9f781cc1fa0385ce699fe49ee2ad2 Mon Sep 17 00:00:00 2001 From: Joshua Liebow-Feeser Date: Mon, 13 Sep 2021 12:39:45 -0700 Subject: [PATCH] `Wrapping` has the same layout and ABI as `T` --- library/core/src/num/wrapping.rs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/library/core/src/num/wrapping.rs b/library/core/src/num/wrapping.rs index be6d70320d407..b078cdf5479d7 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` 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)]