Only assert the Parser
size on specific arches · rust-lang/rust@aef640a (original) (raw)
File tree
1 file changed
lines changed
- compiler/rustc_parse/src/parser
1 file changed
lines changed
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -189,8 +189,9 @@ pub struct Parser<'a> { | ||
189 | 189 | } |
190 | 190 | |
191 | 191 | // This type is used a lot, e.g. it's cloned when matching many declarative macro rules with |
192 | -// nonterminals. Make sure it doesn't unintentionally get bigger. | |
193 | -#[cfg(all(target_pointer_width = "64", not(target_arch = "s390x")))] | |
192 | +// nonterminals. Make sure it doesn't unintentionally get bigger. We only check a few arches | |
193 | +// though, because `TokenTypeSet(u128)` alignment varies on others, changing the total size. | |
194 | +#[cfg(all(target_pointer_width = "64", any(target_arch = "aarch64", target_arch = "x86_64")))] | |
194 | 195 | rustc_data_structures::static_assert_size!(Parser<'_>, 288); |
195 | 196 | |
196 | 197 | /// Stores span information about a closure. |