Assert the size of the refactored enums

This commit is contained in:
Dániel Buga
2021-02-01 09:19:22 +01:00
parent b87e1ecdf0
commit 003fba3fda

View 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 {