@@ -2917,11 +2917,11 @@ pub enum ItemKind {
29172917 /// A static item (`static`).
29182918 ///
29192919 /// E.g., `static FOO: i32 = 42;` or `static FOO: &'static str = "bar";`.
2920- Static ( Static ) ,
2920+ Static ( Box < Static > ) ,
29212921 /// A constant item (`const`).
29222922 ///
29232923 /// E.g., `const FOO: i32 = 42;`.
2924- Const ( ConstItem ) ,
2924+ Const ( Box < ConstItem > ) ,
29252925 /// A function declaration (`fn`).
29262926 ///
29272927 /// E.g., `fn foo(bar: usize) -> usize { .. }`.
@@ -3037,7 +3037,7 @@ pub type AssocItem = Item<AssocItemKind>;
30373037pub enum AssocItemKind {
30383038 /// An associated constant, `const $ident: $ty $def?;` where `def ::= "=" $expr? ;`.
30393039 /// If `def` is parsed, then the constant is provided, and otherwise required.
3040- Const ( ConstItem ) ,
3040+ Const ( Box < ConstItem > ) ,
30413041 /// An associated function.
30423042 Fn ( Box < Fn > ) ,
30433043 /// An associated type.
@@ -3049,7 +3049,7 @@ pub enum AssocItemKind {
30493049impl AssocItemKind {
30503050 pub fn defaultness ( & self ) -> Defaultness {
30513051 match * self {
3052- Self :: Const ( ConstItem { defaultness, .. } )
3052+ Self :: Const ( box ConstItem { defaultness, .. } )
30533053 | Self :: Fn ( box Fn { defaultness, .. } )
30543054 | Self :: Type ( box TyAlias { defaultness, .. } ) => defaultness,
30553055 Self :: MacCall ( ..) => Defaultness :: Final ,
@@ -3099,7 +3099,7 @@ impl From<ForeignItemKind> for ItemKind {
30993099 fn from ( foreign_item_kind : ForeignItemKind ) -> ItemKind {
31003100 match foreign_item_kind {
31013101 ForeignItemKind :: Static ( a, b, c) => {
3102- ItemKind :: Static ( Static { ty : a, mutability : b, expr : c } )
3102+ ItemKind :: Static ( Static { ty : a, mutability : b, expr : c } . into ( ) )
31033103 }
31043104 ForeignItemKind :: Fn ( fn_kind) => ItemKind :: Fn ( fn_kind) ,
31053105 ForeignItemKind :: TyAlias ( ty_alias_kind) => ItemKind :: TyAlias ( ty_alias_kind) ,
@@ -3113,7 +3113,7 @@ impl TryFrom<ItemKind> for ForeignItemKind {
31133113
31143114 fn try_from ( item_kind : ItemKind ) -> Result < ForeignItemKind , ItemKind > {
31153115 Ok ( match item_kind {
3116- ItemKind :: Static ( Static { ty : a, mutability : b, expr : c } ) => {
3116+ ItemKind :: Static ( box Static { ty : a, mutability : b, expr : c } ) => {
31173117 ForeignItemKind :: Static ( a, b, c)
31183118 }
31193119 ItemKind :: Fn ( fn_kind) => ForeignItemKind :: Fn ( fn_kind) ,
@@ -3132,8 +3132,8 @@ mod size_asserts {
31323132 use super :: * ;
31333133 use rustc_data_structures:: static_assert_size;
31343134 // tidy-alphabetical-start
3135- static_assert_size ! ( AssocItem , 104 ) ;
3136- static_assert_size ! ( AssocItemKind , 32 ) ;
3135+ static_assert_size ! ( AssocItem , 88 ) ;
3136+ static_assert_size ! ( AssocItemKind , 16 ) ;
31373137 static_assert_size ! ( Attribute , 32 ) ;
31383138 static_assert_size ! ( Block , 32 ) ;
31393139 static_assert_size ! ( Expr , 72 ) ;
0 commit comments