mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Add a static assertion about the size of ast::Expr
.
This commit is contained in:
parent
49f482f537
commit
fb3dd9f64e
@ -20,6 +20,7 @@ use print::pprust;
|
||||
use ptr::P;
|
||||
use rustc_data_structures::indexed_vec;
|
||||
use rustc_data_structures::indexed_vec::Idx;
|
||||
use rustc_data_structures::static_assert;
|
||||
use rustc_target::spec::abi::Abi;
|
||||
use source_map::{dummy_spanned, respan, Spanned};
|
||||
use symbol::{keywords, Symbol};
|
||||
@ -924,6 +925,10 @@ pub struct Expr {
|
||||
pub attrs: ThinVec<Attribute>,
|
||||
}
|
||||
|
||||
// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
|
||||
#[cfg(target_arch = "x86_64")]
|
||||
static_assert!(MEM_SIZE_OF_EXPR: std::mem::size_of::<Expr>() == 88);
|
||||
|
||||
impl Expr {
|
||||
/// Whether this expression would be valid somewhere that expects a value, for example, an `if`
|
||||
/// condition.
|
||||
|
Loading…
Reference in New Issue
Block a user