about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>2025-07-21 17:03:07 +0200
committerJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>2025-07-21 17:03:07 +0200
commite70112df5f0ff5ebeb4d75d22f66b4b36082c85c (patch)
tree7297bf52faf6b73a30966e5e60ddbc25eb0dcf2d
parent87aa056206fa883963cfa483df5e8e69e0393086 (diff)
downloadrust-e70112df5f0ff5ebeb4d75d22f66b4b36082c85c.tar.gz
rust-e70112df5f0ff5ebeb4d75d22f66b4b36082c85c.zip
hir-def: Don't apply x86_64-specific asserts on x32
This fixes the rustc build on x32 for which struct sizes differ.
-rw-r--r--src/tools/rust-analyzer/crates/hir-def/src/expr_store/path.rs2
-rw-r--r--src/tools/rust-analyzer/crates/hir-def/src/hir/type_ref.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/tools/rust-analyzer/crates/hir-def/src/expr_store/path.rs b/src/tools/rust-analyzer/crates/hir-def/src/expr_store/path.rs
index 19c7ce0ce04..55e738b58bd 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/expr_store/path.rs
+++ b/src/tools/rust-analyzer/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/src/tools/rust-analyzer/crates/hir-def/src/hir/type_ref.rs b/src/tools/rust-analyzer/crates/hir-def/src/hir/type_ref.rs
index eacc3f3cedf..da0f058a9cb 100644
--- a/src/tools/rust-analyzer/crates/hir-def/src/hir/type_ref.rs
+++ b/src/tools/rust-analyzer/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>;