Skip to content

Commit 25122d9

Browse files
committed
hir-def: Don't apply x86_64-specific asserts on x32
This fixes the rustc build on x32 for which struct sizes differ.
1 parent 4c7a8cb commit 25122d9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

crates/hir-def/src/expr_store/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ pub enum Path {
2727
}
2828

2929
// This type is being used a lot, make sure it doesn't grow unintentionally.
30-
#[cfg(target_arch = "x86_64")]
30+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
3131
const _: () = {
3232
assert!(size_of::<Path>() == 24);
3333
assert!(size_of::<Option<Path>>() == 24);

crates/hir-def/src/hir/type_ref.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ pub enum TypeRef {
148148
Error,
149149
}
150150

151-
#[cfg(target_arch = "x86_64")]
151+
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
152152
const _: () = assert!(size_of::<TypeRef>() == 24);
153153

154154
pub type TypeRefId = Idx<TypeRef>;

0 commit comments

Comments
 (0)