diff options
| author | Josh Stone <jistone@redhat.com> | 2025-01-21 17:24:29 -0800 |
|---|---|---|
| committer | Josh Stone <jistone@redhat.com> | 2025-01-25 16:48:11 -0800 |
| commit | f05d305f5a009d4013eb9e334eb6e47c6b87f48e (patch) | |
| tree | 71262899379ea11d0e98ae64c864773221503610 | |
| parent | 5f5e70bfc6391374546a2fd240d8612717af69f4 (diff) | |
| download | rust-f05d305f5a009d4013eb9e334eb6e47c6b87f48e.tar.gz rust-f05d305f5a009d4013eb9e334eb6e47c6b87f48e.zip | |
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. (cherry picked from commit aef640a6130ccb3edf9bc720881c3a9dde3c0ecd)
| -rw-r--r-- | compiler/rustc_parse/src/parser/mod.rs | 5 |
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 2637ea268c8..30871db10a4 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. |
