diff options
| author | bors <bors@rust-lang.org> | 2018-07-04 16:21:42 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2018-07-04 16:21:42 +0000 |
| commit | 0ad8f9e5b1950e4ac09950def4231c8d5875de57 (patch) | |
| tree | 1447e7b31c5844fb8762c0ed0cfc12f607694c68 /src/libcore/num | |
| parent | eded1aa14cb322b3b1000ee98ea9ba3a10dacba1 (diff) | |
| parent | 530d7bc5174e93682a38b22ac7ff4e3569bcd813 (diff) | |
| download | rust-0ad8f9e5b1950e4ac09950def4231c8d5875de57.tar.gz rust-0ad8f9e5b1950e4ac09950def4231c8d5875de57.zip | |
Auto merge of #51395 - SimonSapin:repr-transparent, r=SimonSapin
Add #[repr(transparent)] to some libcore types * `UnsafeCell` * `Cell` * `NonZero*` * `NonNull` * `Unique` CC https://github.com/rust-lang/rust/issues/43036
Diffstat (limited to 'src/libcore/num')
| -rw-r--r-- | src/libcore/num/mod.rs | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/libcore/num/mod.rs b/src/libcore/num/mod.rs index 260ebabf1fa..0b8f8f0703d 100644 --- a/src/libcore/num/mod.rs +++ b/src/libcore/num/mod.rs @@ -48,6 +48,7 @@ macro_rules! nonzero_integers { /// ``` #[stable(feature = "nonzero", since = "1.28.0")] #[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)] + #[repr(transparent)] pub struct $Ty(NonZero<$Int>); impl $Ty { @@ -123,6 +124,7 @@ nonzero_integers! { /// ``` #[stable(feature = "rust1", since = "1.0.0")] #[derive(PartialEq, Eq, PartialOrd, Ord, Clone, Copy, Default, Hash)] +#[repr(transparent)] pub struct Wrapping<T>(#[stable(feature = "rust1", since = "1.0.0")] pub T); |
