@@ -2917,11 +2917,11 @@ pub enum ItemKind {
2917
2917
/// A static item (`static`).
2918
2918
///
2919
2919
/// E.g., `static FOO: i32 = 42;` or `static FOO: &'static str = "bar";`.
2920
- Static ( Static ) ,
2920
+ Static ( Box < Static > ) ,
2921
2921
/// A constant item (`const`).
2922
2922
///
2923
2923
/// E.g., `const FOO: i32 = 42;`.
2924
- Const ( ConstItem ) ,
2924
+ Const ( Box < ConstItem > ) ,
2925
2925
/// A function declaration (`fn`).
2926
2926
///
2927
2927
/// E.g., `fn foo(bar: usize) -> usize { .. }`.
@@ -3037,7 +3037,7 @@ pub type AssocItem = Item<AssocItemKind>;
3037
3037
pub enum AssocItemKind {
3038
3038
/// An associated constant, `const $ident: $ty $def?;` where `def ::= "=" $expr? ;`.
3039
3039
/// If `def` is parsed, then the constant is provided, and otherwise required.
3040
- Const ( ConstItem ) ,
3040
+ Const ( Box < ConstItem > ) ,
3041
3041
/// An associated function.
3042
3042
Fn ( Box < Fn > ) ,
3043
3043
/// An associated type.
@@ -3049,7 +3049,7 @@ pub enum AssocItemKind {
3049
3049
impl AssocItemKind {
3050
3050
pub fn defaultness ( & self ) -> Defaultness {
3051
3051
match * self {
3052
- Self :: Const ( ConstItem { defaultness, .. } )
3052
+ Self :: Const ( box ConstItem { defaultness, .. } )
3053
3053
| Self :: Fn ( box Fn { defaultness, .. } )
3054
3054
| Self :: Type ( box TyAlias { defaultness, .. } ) => defaultness,
3055
3055
Self :: MacCall ( ..) => Defaultness :: Final ,
@@ -3099,7 +3099,7 @@ impl From<ForeignItemKind> for ItemKind {
3099
3099
fn from ( foreign_item_kind : ForeignItemKind ) -> ItemKind {
3100
3100
match foreign_item_kind {
3101
3101
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 ( ) )
3103
3103
}
3104
3104
ForeignItemKind :: Fn ( fn_kind) => ItemKind :: Fn ( fn_kind) ,
3105
3105
ForeignItemKind :: TyAlias ( ty_alias_kind) => ItemKind :: TyAlias ( ty_alias_kind) ,
@@ -3113,7 +3113,7 @@ impl TryFrom<ItemKind> for ForeignItemKind {
3113
3113
3114
3114
fn try_from ( item_kind : ItemKind ) -> Result < ForeignItemKind , ItemKind > {
3115
3115
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 } ) => {
3117
3117
ForeignItemKind :: Static ( a, b, c)
3118
3118
}
3119
3119
ItemKind :: Fn ( fn_kind) => ForeignItemKind :: Fn ( fn_kind) ,
@@ -3132,8 +3132,8 @@ mod size_asserts {
3132
3132
use super :: * ;
3133
3133
use rustc_data_structures:: static_assert_size;
3134
3134
// 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 ) ;
3137
3137
static_assert_size ! ( Attribute , 32 ) ;
3138
3138
static_assert_size ! ( Block , 32 ) ;
3139
3139
static_assert_size ! ( Expr , 72 ) ;
0 commit comments