Rollup merge of #100003 - nnethercote:improve-size-assertions, r=lqd
Improve size assertions. - For any file with four or more size assertions, move them into a separate module (as is already done for `hir.rs`). - Add some more for AST nodes and THIR nodes. - Put the `hir.rs` ones in alphabetical order. r? `@lqd`
This commit is contained in:
@@ -190,10 +190,6 @@ pub enum StmtKind<'tcx> {
|
||||
},
|
||||
}
|
||||
|
||||
// `Expr` is used a lot. Make sure it doesn't unintentionally get bigger.
|
||||
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
|
||||
rustc_data_structures::static_assert_size!(Expr<'_>, 104);
|
||||
|
||||
#[derive(Clone, Debug, Copy, PartialEq, Eq, Hash, HashStable, TyEncodable, TyDecodable)]
|
||||
#[derive(TypeFoldable, TypeVisitable)]
|
||||
pub struct LocalVarId(pub hir::HirId);
|
||||
@@ -812,3 +808,14 @@ impl<'tcx> fmt::Display for Pat<'tcx> {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Some nodes are used a lot. Make sure they don't unintentionally get bigger.
|
||||
#[cfg(all(target_arch = "x86_64", target_pointer_width = "64"))]
|
||||
mod size_asserts {
|
||||
use super::*;
|
||||
// These are in alphabetical order, which is easy to maintain.
|
||||
rustc_data_structures::static_assert_size!(Block, 56);
|
||||
rustc_data_structures::static_assert_size!(Expr<'_>, 104);
|
||||
rustc_data_structures::static_assert_size!(Pat<'_>, 24);
|
||||
rustc_data_structures::static_assert_size!(Stmt<'_>, 120);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user