@@ -3661,15 +3661,19 @@ pub struct TyAlias {
36613661
36623662#[ derive( Clone , Encodable , Decodable , Debug ) ]
36633663pub struct Impl {
3664+ pub generics : Generics ,
3665+ pub of_trait : Option < Box < TraitImplHeader > > ,
3666+ pub self_ty : Box < Ty > ,
3667+ pub items : ThinVec < Box < AssocItem > > ,
3668+ }
3669+
3670+ #[ derive( Clone , Encodable , Decodable , Debug ) ]
3671+ pub struct TraitImplHeader {
36643672 pub defaultness : Defaultness ,
36653673 pub safety : Safety ,
3666- pub generics : Generics ,
36673674 pub constness : Const ,
36683675 pub polarity : ImplPolarity ,
3669- /// The trait being implemented, if any.
3670- pub of_trait : Option < TraitRef > ,
3671- pub self_ty : Box < Ty > ,
3672- pub items : ThinVec < Box < AssocItem > > ,
3676+ pub trait_ref : TraitRef ,
36733677}
36743678
36753679#[ derive( Clone , Encodable , Decodable , Debug , Default , Walkable ) ]
@@ -3793,7 +3797,7 @@ pub enum ItemKind {
37933797 /// An implementation.
37943798 ///
37953799 /// E.g., `impl<A> Foo<A> { .. }` or `impl<A> Trait for Foo<A> { .. }`.
3796- Impl ( Box < Impl > ) ,
3800+ Impl ( Impl ) ,
37973801 /// A macro invocation.
37983802 ///
37993803 /// E.g., `foo!(..)`.
@@ -3880,7 +3884,7 @@ impl ItemKind {
38803884 | Self :: Union ( _, generics, _)
38813885 | Self :: Trait ( box Trait { generics, .. } )
38823886 | Self :: TraitAlias ( _, generics, _)
3883- | Self :: Impl ( box Impl { generics, .. } ) => Some ( generics) ,
3887+ | Self :: Impl ( Impl { generics, .. } ) => Some ( generics) ,
38843888 _ => None ,
38853889 }
38863890 }
@@ -4040,7 +4044,7 @@ mod size_asserts {
40404044 static_assert_size ! ( GenericArg , 24 ) ;
40414045 static_assert_size ! ( GenericBound , 88 ) ;
40424046 static_assert_size ! ( Generics , 40 ) ;
4043- static_assert_size ! ( Impl , 136 ) ;
4047+ static_assert_size ! ( Impl , 64 ) ;
40444048 static_assert_size ! ( Item , 144 ) ;
40454049 static_assert_size ! ( ItemKind , 80 ) ;
40464050 static_assert_size ! ( LitKind , 24 ) ;
@@ -4053,6 +4057,7 @@ mod size_asserts {
40534057 static_assert_size ! ( PathSegment , 24 ) ;
40544058 static_assert_size ! ( Stmt , 32 ) ;
40554059 static_assert_size ! ( StmtKind , 16 ) ;
4060+ static_assert_size ! ( TraitImplHeader , 80 ) ;
40564061 static_assert_size ! ( Ty , 64 ) ;
40574062 static_assert_size ! ( TyKind , 40 ) ;
40584063 // tidy-alphabetical-end
0 commit comments