Skip to content

Commit 003fba3

Browse files
committed
Assert the size of the refactored enums
1 parent b87e1ec commit 003fba3

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

compiler/rustc_ast/src/ast.rs

+10
Original file line numberDiff line numberDiff line change
@@ -2663,6 +2663,7 @@ pub struct TraitKind(
26632663
pub GenericBounds,
26642664
pub Vec<P<AssocItem>>,
26652665
);
2666+
26662667
#[derive(Clone, Encodable, Decodable, Debug)]
26672668
pub struct TyAliasKind(pub Defaultness, pub Generics, pub GenericBounds, pub Option<P<Ty>>);
26682669

@@ -2753,6 +2754,9 @@ pub enum ItemKind {
27532754
MacroDef(MacroDef),
27542755
}
27552756

2757+
#[cfg(target_arch = "x86_64")]
2758+
rustc_data_structures::static_assert_size!(ItemKind, 112);
2759+
27562760
impl ItemKind {
27572761
pub fn article(&self) -> &str {
27582762
use ItemKind::*;
@@ -2824,6 +2828,9 @@ pub enum AssocItemKind {
28242828
MacCall(MacCall),
28252829
}
28262830

2831+
#[cfg(target_arch = "x86_64")]
2832+
rustc_data_structures::static_assert_size!(AssocItemKind, 72);
2833+
28272834
impl AssocItemKind {
28282835
pub fn defaultness(&self) -> Defaultness {
28292836
match *self {
@@ -2873,6 +2880,9 @@ pub enum ForeignItemKind {
28732880
MacCall(MacCall),
28742881
}
28752882

2883+
#[cfg(target_arch = "x86_64")]
2884+
rustc_data_structures::static_assert_size!(ForeignItemKind, 72);
2885+
28762886
impl From<ForeignItemKind> for ItemKind {
28772887
fn from(foreign_item_kind: ForeignItemKind) -> ItemKind {
28782888
match foreign_item_kind {

0 commit comments

Comments
 (0)