diff options
| author | kennytm <kennytm@gmail.com> | 2018-11-13 13:03:09 +0800 |
|---|---|---|
| committer | kennytm <kennytm@gmail.com> | 2018-11-13 19:20:28 +0800 |
| commit | 98bc7d63fbc78643532853db3cb289bacc86167c (patch) | |
| tree | 5c83d9eb185c22820484d44ece754200a29eb882 /src/libsyntax | |
| parent | d811f844a5e992f8a2533fc440421a4b3cf7056f (diff) | |
| parent | 2bd4d5b1a0b05827401970f0cfbe17e6b6f32d0d (diff) | |
| download | rust-98bc7d63fbc78643532853db3cb289bacc86167c.tar.gz rust-98bc7d63fbc78643532853db3cb289bacc86167c.zip | |
Rollup merge of #55805 - nnethercote:mv-static_assert, r=Mark-Simulacrum
Move `static_assert!` into librustc_data_structures
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/ast.rs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libsyntax/ast.rs b/src/libsyntax/ast.rs index 2f17bc0548c..808e19d6f12 100644 --- a/src/libsyntax/ast.rs +++ b/src/libsyntax/ast.rs @@ -20,6 +20,8 @@ use print::pprust; use ptr::P; use rustc_data_structures::indexed_vec; use rustc_data_structures::indexed_vec::Idx; +#[cfg(target_arch = "x86_64")] +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 +926,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. |
