diff options
| author | Simon Sapin <simon.sapin@exyr.org> | 2018-06-06 13:30:35 +0200 |
|---|---|---|
| committer | Simon Sapin <simon.sapin@exyr.org> | 2018-06-16 18:25:15 +0200 |
| commit | 530d7bc5174e93682a38b22ac7ff4e3569bcd813 (patch) | |
| tree | b3e20df02eeac01e46a7fc7e024977847ecf7a81 /src/libcore/num | |
| parent | 253205658edc477a0b429f3ce25a92099dc7ddc4 (diff) | |
| download | rust-530d7bc5174e93682a38b22ac7ff4e3569bcd813.tar.gz rust-530d7bc5174e93682a38b22ac7ff4e3569bcd813.zip | |
Add #[repr(transparent)] to some libcore types
* `UnsafeCell` * `Cell` * `NonZero*` * `NonNull` * `Unique`
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 1168126c47c..3aeb1183218 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); |
