Auto merge of #124008 - nnethercote:simpler-static_assert_size, r=Nilstrieb

Simplify `static_assert_size`s.

We want to run them on all 64-bit platforms.

r? `@ghost`
This commit is contained in:
bors 2024-04-18 09:47:45 +00:00
commit c25473ff62
36 changed files with 45 additions and 43 deletions

View file

@ -30,7 +30,7 @@ use unescape_error_reporting::{emit_unescape_error, escaped_char};
//
// This assertion is in this crate, rather than in `rustc_lexer`, because that
// crate cannot depend on `rustc_data_structures`.
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
#[cfg(target_pointer_width = "64")]
rustc_data_structures::static_assert_size!(rustc_lexer::Token, 12);
#[derive(Clone, Debug)]

View file

@ -454,7 +454,7 @@ fn make_token_stream(
}
// Some types are used a lot. Make sure they don't unintentionally get bigger.
#[cfg(all(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
#[cfg(target_pointer_width = "64")]
mod size_asserts {
use super::*;
use rustc_data_structures::static_assert_size;

View file

@ -179,7 +179,7 @@ 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(any(target_arch = "x86_64", target_arch = "aarch64"), target_pointer_width = "64"))]
#[cfg(target_pointer_width = "64")]
rustc_data_structures::static_assert_size!(Parser<'_>, 264);
/// Stores span information about a closure.