@@ -3661,15 +3661,19 @@ pub struct TyAlias {
3661
3661
3662
3662
#[ derive( Clone , Encodable , Decodable , Debug ) ]
3663
3663
pub 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 {
3664
3672
pub defaultness : Defaultness ,
3665
3673
pub safety : Safety ,
3666
- pub generics : Generics ,
3667
3674
pub constness : Const ,
3668
3675
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 ,
3673
3677
}
3674
3678
3675
3679
#[ derive( Clone , Encodable , Decodable , Debug , Default , Walkable ) ]
@@ -3793,7 +3797,7 @@ pub enum ItemKind {
3793
3797
/// An implementation.
3794
3798
///
3795
3799
/// E.g., `impl<A> Foo<A> { .. }` or `impl<A> Trait for Foo<A> { .. }`.
3796
- Impl ( Box < Impl > ) ,
3800
+ Impl ( Impl ) ,
3797
3801
/// A macro invocation.
3798
3802
///
3799
3803
/// E.g., `foo!(..)`.
@@ -3880,7 +3884,7 @@ impl ItemKind {
3880
3884
| Self :: Union ( _, generics, _)
3881
3885
| Self :: Trait ( box Trait { generics, .. } )
3882
3886
| Self :: TraitAlias ( _, generics, _)
3883
- | Self :: Impl ( box Impl { generics, .. } ) => Some ( generics) ,
3887
+ | Self :: Impl ( Impl { generics, .. } ) => Some ( generics) ,
3884
3888
_ => None ,
3885
3889
}
3886
3890
}
@@ -4040,7 +4044,7 @@ mod size_asserts {
4040
4044
static_assert_size ! ( GenericArg , 24 ) ;
4041
4045
static_assert_size ! ( GenericBound , 88 ) ;
4042
4046
static_assert_size ! ( Generics , 40 ) ;
4043
- static_assert_size ! ( Impl , 136 ) ;
4047
+ static_assert_size ! ( Impl , 64 ) ;
4044
4048
static_assert_size ! ( Item , 144 ) ;
4045
4049
static_assert_size ! ( ItemKind , 80 ) ;
4046
4050
static_assert_size ! ( LitKind , 24 ) ;
@@ -4053,6 +4057,7 @@ mod size_asserts {
4053
4057
static_assert_size ! ( PathSegment , 24 ) ;
4054
4058
static_assert_size ! ( Stmt , 32 ) ;
4055
4059
static_assert_size ! ( StmtKind , 16 ) ;
4060
+ static_assert_size ! ( TraitImplHeader , 80 ) ;
4056
4061
static_assert_size ! ( Ty , 64 ) ;
4057
4062
static_assert_size ! ( TyKind , 40 ) ;
4058
4063
// tidy-alphabetical-end
0 commit comments