about summary refs log tree commit diff
path: root/library/core
diff options
context:
space:
mode:
authorr0cky <mu001999@outlook.com>2024-02-29 09:25:28 +0800
committerr0cky <mu001999@outlook.com>2024-02-29 09:25:28 +0800
commit61fcdf66557d99e179caf7f8dc00e558b22ce723 (patch)
tree92973cf0107372b94f554ef4ae61d03122659730 /library/core
parentef324565d071c6d7e2477a195648549e33d6a465 (diff)
downloadrust-61fcdf66557d99e179caf7f8dc00e558b22ce723.tar.gz
rust-61fcdf66557d99e179caf7f8dc00e558b22ce723.zip
Add proper cfg
Diffstat (limited to 'library/core')
-rw-r--r--library/core/src/ptr/alignment.rs14
1 files changed, 5 insertions, 9 deletions
diff --git a/library/core/src/ptr/alignment.rs b/library/core/src/ptr/alignment.rs
index bd58c167c2e..3eea065eef6 100644
--- a/library/core/src/ptr/alignment.rs
+++ b/library/core/src/ptr/alignment.rs
@@ -234,15 +234,9 @@ impl Default for Alignment {
 }
 
 #[cfg(target_pointer_width = "16")]
-type AlignmentEnum = AlignmentEnum16;
-#[cfg(target_pointer_width = "32")]
-type AlignmentEnum = AlignmentEnum32;
-#[cfg(target_pointer_width = "64")]
-type AlignmentEnum = AlignmentEnum64;
-
 #[derive(Copy, Clone, PartialEq, Eq)]
 #[repr(u16)]
-enum AlignmentEnum16 {
+enum AlignmentEnum {
     _Align1Shl0 = 1 << 0,
     _Align1Shl1 = 1 << 1,
     _Align1Shl2 = 1 << 2,
@@ -261,9 +255,10 @@ enum AlignmentEnum16 {
     _Align1Shl15 = 1 << 15,
 }
 
+#[cfg(target_pointer_width = "32")]
 #[derive(Copy, Clone, PartialEq, Eq)]
 #[repr(u32)]
-enum AlignmentEnum32 {
+enum AlignmentEnum {
     _Align1Shl0 = 1 << 0,
     _Align1Shl1 = 1 << 1,
     _Align1Shl2 = 1 << 2,
@@ -298,9 +293,10 @@ enum AlignmentEnum32 {
     _Align1Shl31 = 1 << 31,
 }
 
+#[cfg(target_pointer_width = "64")]
 #[derive(Copy, Clone, PartialEq, Eq)]
 #[repr(u64)]
-enum AlignmentEnum64 {
+enum AlignmentEnum {
     _Align1Shl0 = 1 << 0,
     _Align1Shl1 = 1 << 1,
     _Align1Shl2 = 1 << 2,