Unnamed repository; edit this file 'description' to name the repository.
hir-def: Don't apply x86_64-specific asserts on x32
This fixes the rustc build on x32 for which struct sizes differ.
John Paul Adrian Glaubitz 9 months ago
parent 4c7a8cb · commit 25122d9
-rw-r--r--crates/hir-def/src/expr_store/path.rs2
-rw-r--r--crates/hir-def/src/hir/type_ref.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/crates/hir-def/src/expr_store/path.rs b/crates/hir-def/src/expr_store/path.rs
index 19c7ce0ce0..55e738b58b 100644
--- a/crates/hir-def/src/expr_store/path.rs
+++ b/crates/hir-def/src/expr_store/path.rs
@@ -27,7 +27,7 @@ pub enum Path {
}
// This type is being used a lot, make sure it doesn't grow unintentionally.
-#[cfg(target_arch = "x86_64")]
+#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
const _: () = {
assert!(size_of::<Path>() == 24);
assert!(size_of::<Option<Path>>() == 24);
diff --git a/crates/hir-def/src/hir/type_ref.rs b/crates/hir-def/src/hir/type_ref.rs
index eacc3f3ced..da0f058a9c 100644
--- a/crates/hir-def/src/hir/type_ref.rs
+++ b/crates/hir-def/src/hir/type_ref.rs
@@ -148,7 +148,7 @@ pub enum TypeRef {
Error,
}
-#[cfg(target_arch = "x86_64")]
+#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
const _: () = assert!(size_of::<TypeRef>() == 24);
pub type TypeRefId = Idx<TypeRef>;