about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2025-01-24 00:15:56 +0100
committerGitHub <noreply@github.com>2025-01-24 00:15:56 +0100
commitec508127940971c7687078df2ad8d8f59ca06bbb (patch)
tree75df5752162f9e52d52d8d40b1fe2348e472e81e /compiler/rustc_parse/src
parentc4f499a8c3abe4737121ebed767e0fd7b1595839 (diff)
parentaef640a6130ccb3edf9bc720881c3a9dde3c0ecd (diff)
downloadrust-ec508127940971c7687078df2ad8d8f59ca06bbb.tar.gz
rust-ec508127940971c7687078df2ad8d8f59ca06bbb.zip
Rollup merge of #135855 - cuviper:parser-size, r=wesleywiser
Only assert the `Parser` size on specific arches

The size of this struct depends on the alignment of `u128`, for example
powerpc64le and s390x have align-8 and end up with only 280 bytes. Our
64-bit tier-1 arches are the same though, so let's just assert on those.

r? nnethercote
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index 10756be6afb..25d8eb9b453 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -189,8 +189,9 @@ pub struct Parser<'a> {
 }
 
 // This type is used a lot, e.g. it's cloned when matching many declarative macro rules with
-// nonterminals. Make sure it doesn't unintentionally get bigger.
-#[cfg(all(target_pointer_width = "64", not(target_arch = "s390x")))]
+// nonterminals. Make sure it doesn't unintentionally get bigger. We only check a few arches
+// though, because `TokenTypeSet(u128)` alignment varies on others, changing the total size.
+#[cfg(all(target_pointer_width = "64", any(target_arch = "aarch64", target_arch = "x86_64")))]
 rustc_data_structures::static_assert_size!(Parser<'_>, 288);
 
 /// Stores span information about a closure.