From 003fba3fdac2bcad6dbf067bc0e9eb0d1cdf7349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A1niel=20Buga?= Date: Mon, 1 Feb 2021 09:19:22 +0100 Subject: [PATCH] Assert the size of the refactored enums --- compiler/rustc_ast/src/ast.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index ea79782ece1aa..2ddcb9ef844e9 100644 --- a/compiler/rustc_ast/src/ast.rs +++ b/compiler/rustc_ast/src/ast.rs @@ -2663,6 +2663,7 @@ pub struct TraitKind( pub GenericBounds, pub Vec>, ); + #[derive(Clone, Encodable, Decodable, Debug)] pub struct TyAliasKind(pub Defaultness, pub Generics, pub GenericBounds, pub Option>); @@ -2753,6 +2754,9 @@ pub enum ItemKind { MacroDef(MacroDef), } +#[cfg(target_arch = "x86_64")] +rustc_data_structures::static_assert_size!(ItemKind, 112); + impl ItemKind { pub fn article(&self) -> &str { use ItemKind::*; @@ -2824,6 +2828,9 @@ pub enum AssocItemKind { MacCall(MacCall), } +#[cfg(target_arch = "x86_64")] +rustc_data_structures::static_assert_size!(AssocItemKind, 72); + impl AssocItemKind { pub fn defaultness(&self) -> Defaultness { match *self { @@ -2873,6 +2880,9 @@ pub enum ForeignItemKind { MacCall(MacCall), } +#[cfg(target_arch = "x86_64")] +rustc_data_structures::static_assert_size!(ForeignItemKind, 72); + impl From for ItemKind { fn from(foreign_item_kind: ForeignItemKind) -> ItemKind { match foreign_item_kind {