diff options
| author | Dániel Buga <bugadani@gmail.com> | 2021-02-01 09:19:22 +0100 |
|---|---|---|
| committer | Dániel Buga <bugadani@gmail.com> | 2021-02-01 09:23:40 +0100 |
| commit | 003fba3fdac2bcad6dbf067bc0e9eb0d1cdf7349 (patch) | |
| tree | 468a421a86e988c72bdb4233f156ec5422a084e9 | |
| parent | b87e1ecdf05d4fb2d14f13d760bb37098c58b06e (diff) | |
| download | rust-003fba3fdac2bcad6dbf067bc0e9eb0d1cdf7349.tar.gz rust-003fba3fdac2bcad6dbf067bc0e9eb0d1cdf7349.zip | |
Assert the size of the refactored enums
| -rw-r--r-- | compiler/rustc_ast/src/ast.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/compiler/rustc_ast/src/ast.rs b/compiler/rustc_ast/src/ast.rs index ea79782ece1..2ddcb9ef844 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<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 { |
