@@ -3540,8 +3540,9 @@ impl Item {
35403540 ItemKind :: Const ( i) => Some ( & i. generics ) ,
35413541 ItemKind :: Fn ( i) => Some ( & i. generics ) ,
35423542 ItemKind :: TyAlias ( i) => Some ( & i. generics ) ,
3543- ItemKind :: TraitAlias ( _, generics, _)
3544- | ItemKind :: Enum ( _, generics, _)
3543+ ItemKind :: TraitAlias ( i) => Some ( & i. generics ) ,
3544+
3545+ ItemKind :: Enum ( _, generics, _)
35453546 | ItemKind :: Struct ( _, generics, _)
35463547 | ItemKind :: Union ( _, generics, _) => Some ( & generics) ,
35473548 ItemKind :: Trait ( i) => Some ( & i. generics ) ,
@@ -3623,6 +3624,14 @@ impl Default for FnHeader {
36233624 }
36243625}
36253626
3627+ #[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
3628+ pub struct TraitAlias {
3629+ pub ident : Ident ,
3630+ pub generics : Generics ,
3631+ #[ visitable( extra = BoundKind :: Bound ) ]
3632+ pub bounds : GenericBounds ,
3633+ }
3634+
36263635#[ derive( Clone , Encodable , Decodable , Debug , Walkable ) ]
36273636pub struct Trait {
36283637 pub constness : Const ,
@@ -3795,7 +3804,7 @@ pub enum ItemKind {
37953804 /// Trait alias.
37963805 ///
37973806 /// E.g., `trait Foo = Bar + Quux;`.
3798- TraitAlias ( Ident , Generics , GenericBounds ) ,
3807+ TraitAlias ( Box < TraitAlias > ) ,
37993808 /// An implementation.
38003809 ///
38013810 /// E.g., `impl<A> Foo<A> { .. }` or `impl<A> Trait for Foo<A> { .. }`.
@@ -3828,7 +3837,7 @@ impl ItemKind {
38283837 | ItemKind :: Struct ( ident, ..)
38293838 | ItemKind :: Union ( ident, ..)
38303839 | ItemKind :: Trait ( box Trait { ident, .. } )
3831- | ItemKind :: TraitAlias ( ident, ..)
3840+ | ItemKind :: TraitAlias ( box TraitAlias { ident, .. } )
38323841 | ItemKind :: MacroDef ( ident, _)
38333842 | ItemKind :: Delegation ( box Delegation { ident, .. } ) => Some ( ident) ,
38343843
@@ -3885,7 +3894,7 @@ impl ItemKind {
38853894 | Self :: Struct ( _, generics, _)
38863895 | Self :: Union ( _, generics, _)
38873896 | Self :: Trait ( box Trait { generics, .. } )
3888- | Self :: TraitAlias ( _ , generics, _ )
3897+ | Self :: TraitAlias ( box TraitAlias { generics, .. } )
38893898 | Self :: Impl ( Impl { generics, .. } ) => Some ( generics) ,
38903899 _ => None ,
38913900 }
@@ -4047,8 +4056,8 @@ mod size_asserts {
40474056 static_assert_size ! ( GenericBound , 88 ) ;
40484057 static_assert_size ! ( Generics , 40 ) ;
40494058 static_assert_size ! ( Impl , 64 ) ;
4050- static_assert_size ! ( Item , 144 ) ;
4051- static_assert_size ! ( ItemKind , 80 ) ;
4059+ static_assert_size ! ( Item , 136 ) ;
4060+ static_assert_size ! ( ItemKind , 72 ) ;
40524061 static_assert_size ! ( LitKind , 24 ) ;
40534062 static_assert_size ! ( Local , 96 ) ;
40544063 static_assert_size ! ( MetaItemLit , 40 ) ;
0 commit comments