]> git.lizzy.rs Git - rust.git/commitdiff
Assert the size of the refactored enums
authorDániel Buga <bugadani@gmail.com>
Mon, 1 Feb 2021 08:19:22 +0000 (09:19 +0100)
committerDániel Buga <bugadani@gmail.com>
Mon, 1 Feb 2021 08:23:40 +0000 (09:23 +0100)
compiler/rustc_ast/src/ast.rs

index ea79782ece1aa7cafcf1c7b084180914a84959e0..2ddcb9ef844e954668c7a65661791e2e4813d858 100644 (file)
@@ -2663,6 +2663,7 @@ pub struct TraitKind(
     pub GenericBounds,
     pub Vec<P<AssocItem>>,
 );
+
 #[derive(Clone, Encodable, Decodable, Debug)]
 pub struct TyAliasKind(pub Defaultness, pub Generics, pub GenericBounds, pub Option<P<Ty>>);
 
@@ -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<ForeignItemKind> for ItemKind {
     fn from(foreign_item_kind: ForeignItemKind) -> ItemKind {
         match foreign_item_kind {