@@ -4106,11 +4106,11 @@ impl<'hir> Item<'hir> {
41064106
41074107 expect_use, ( & ' hir UsePath <' hir>, UseKind ) , ItemKind :: Use ( p, uk) , ( p, * uk) ;
41084108
4109- expect_static, ( Ident , & ' hir Ty <' hir>, Mutability , BodyId ) ,
4110- ItemKind :: Static ( ident, ty, mutbl , body) , ( * ident , ty , * mutbl , * body) ;
4109+ expect_static, ( Mutability , Ident , & ' hir Ty <' hir>, BodyId ) ,
4110+ ItemKind :: Static ( mutbl , ident, ty, body) , ( * mutbl , * ident , ty , * body) ;
41114111
4112- expect_const, ( Ident , & ' hir Ty <' hir>, & ' hir Generics <' hir>, BodyId ) ,
4113- ItemKind :: Const ( ident, ty , generics , body) , ( * ident, ty , generics , * body) ;
4112+ expect_const, ( Ident , & ' hir Generics <' hir>, & ' hir Ty <' hir>, BodyId ) ,
4113+ ItemKind :: Const ( ident, generics , ty , body) , ( * ident, generics , ty , * body) ;
41144114
41154115 expect_fn, ( Ident , & FnSig <' hir>, & ' hir Generics <' hir>, BodyId ) ,
41164116 ItemKind :: Fn { ident, sig, generics, body, .. } , ( * ident, sig, generics, * body) ;
@@ -4125,17 +4125,17 @@ impl<'hir> Item<'hir> {
41254125
41264126 expect_global_asm, & ' hir InlineAsm <' hir>, ItemKind :: GlobalAsm { asm, .. } , asm;
41274127
4128- expect_ty_alias, ( Ident , & ' hir Ty <' hir>, & ' hir Generics <' hir>) ,
4129- ItemKind :: TyAlias ( ident, ty , generics ) , ( * ident, ty , generics ) ;
4128+ expect_ty_alias, ( Ident , & ' hir Generics <' hir>, & ' hir Ty <' hir>) ,
4129+ ItemKind :: TyAlias ( ident, generics , ty ) , ( * ident, generics , ty ) ;
41304130
4131- expect_enum, ( Ident , & EnumDef <' hir>, & ' hir Generics <' hir>) ,
4132- ItemKind :: Enum ( ident, def , generics ) , ( * ident, def , generics ) ;
4131+ expect_enum, ( Ident , & ' hir Generics <' hir>, & EnumDef <' hir>) ,
4132+ ItemKind :: Enum ( ident, generics , def ) , ( * ident, generics , def ) ;
41334133
4134- expect_struct, ( Ident , & VariantData <' hir>, & ' hir Generics <' hir>) ,
4135- ItemKind :: Struct ( ident, data , generics ) , ( * ident, data , generics ) ;
4134+ expect_struct, ( Ident , & ' hir Generics <' hir>, & VariantData <' hir>) ,
4135+ ItemKind :: Struct ( ident, generics , data ) , ( * ident, generics , data ) ;
41364136
4137- expect_union, ( Ident , & VariantData <' hir>, & ' hir Generics <' hir>) ,
4138- ItemKind :: Union ( ident, data , generics ) , ( * ident, data , generics ) ;
4137+ expect_union, ( Ident , & ' hir Generics <' hir>, & VariantData <' hir>) ,
4138+ ItemKind :: Union ( ident, generics , data ) , ( * ident, generics , data ) ;
41394139
41404140 expect_trait,
41414141 (
@@ -4278,13 +4278,13 @@ pub enum ItemKind<'hir> {
42784278 Use ( & ' hir UsePath < ' hir > , UseKind ) ,
42794279
42804280 /// A `static` item.
4281- Static ( Ident , & ' hir Ty < ' hir > , Mutability , BodyId ) ,
4281+ Static ( Mutability , Ident , & ' hir Ty < ' hir > , BodyId ) ,
42824282 /// A `const` item.
4283- Const ( Ident , & ' hir Ty < ' hir > , & ' hir Generics < ' hir > , BodyId ) ,
4283+ Const ( Ident , & ' hir Generics < ' hir > , & ' hir Ty < ' hir > , BodyId ) ,
42844284 /// A function declaration.
42854285 Fn {
4286- ident : Ident ,
42874286 sig : FnSig < ' hir > ,
4287+ ident : Ident ,
42884288 generics : & ' hir Generics < ' hir > ,
42894289 body : BodyId ,
42904290 /// Whether this function actually has a body.
@@ -4309,13 +4309,13 @@ pub enum ItemKind<'hir> {
43094309 fake_body : BodyId ,
43104310 } ,
43114311 /// A type alias, e.g., `type Foo = Bar<u8>`.
4312- TyAlias ( Ident , & ' hir Ty < ' hir > , & ' hir Generics < ' hir > ) ,
4312+ TyAlias ( Ident , & ' hir Generics < ' hir > , & ' hir Ty < ' hir > ) ,
43134313 /// An enum definition, e.g., `enum Foo<A, B> { C<A>, D<B> }`.
4314- Enum ( Ident , EnumDef < ' hir > , & ' hir Generics < ' hir > ) ,
4314+ Enum ( Ident , & ' hir Generics < ' hir > , EnumDef < ' hir > ) ,
43154315 /// A struct definition, e.g., `struct Foo<A> {x: A}`.
4316- Struct ( Ident , VariantData < ' hir > , & ' hir Generics < ' hir > ) ,
4316+ Struct ( Ident , & ' hir Generics < ' hir > , VariantData < ' hir > ) ,
43174317 /// A union definition, e.g., `union Foo<A, B> {x: A, y: B}`.
4318- Union ( Ident , VariantData < ' hir > , & ' hir Generics < ' hir > ) ,
4318+ Union ( Ident , & ' hir Generics < ' hir > , VariantData < ' hir > ) ,
43194319 /// A trait definition.
43204320 Trait ( IsAuto , Safety , Ident , & ' hir Generics < ' hir > , GenericBounds < ' hir > , & ' hir [ TraitItemRef ] ) ,
43214321 /// A trait alias.
@@ -4352,7 +4352,7 @@ impl ItemKind<'_> {
43524352 match * self {
43534353 ItemKind :: ExternCrate ( _, ident)
43544354 | ItemKind :: Use ( _, UseKind :: Single ( ident) )
4355- | ItemKind :: Static ( ident, ..)
4355+ | ItemKind :: Static ( _ , ident, ..)
43564356 | ItemKind :: Const ( ident, ..)
43574357 | ItemKind :: Fn { ident, .. }
43584358 | ItemKind :: Macro ( ident, ..)
@@ -4374,11 +4374,11 @@ impl ItemKind<'_> {
43744374 pub fn generics ( & self ) -> Option < & Generics < ' _ > > {
43754375 Some ( match self {
43764376 ItemKind :: Fn { generics, .. }
4377- | ItemKind :: TyAlias ( _, _ , generics )
4378- | ItemKind :: Const ( _, _ , generics , _)
4379- | ItemKind :: Enum ( _, _ , generics )
4380- | ItemKind :: Struct ( _, _ , generics )
4381- | ItemKind :: Union ( _, _ , generics )
4377+ | ItemKind :: TyAlias ( _, generics , _ )
4378+ | ItemKind :: Const ( _, generics , _ , _)
4379+ | ItemKind :: Enum ( _, generics , _ )
4380+ | ItemKind :: Struct ( _, generics , _ )
4381+ | ItemKind :: Union ( _, generics , _ )
43824382 | ItemKind :: Trait ( _, _, _, generics, _, _)
43834383 | ItemKind :: TraitAlias ( _, generics, _)
43844384 | ItemKind :: Impl ( Impl { generics, .. } ) => generics,
@@ -4802,9 +4802,9 @@ impl<'hir> Node<'hir> {
48024802 pub fn ty ( self ) -> Option < & ' hir Ty < ' hir > > {
48034803 match self {
48044804 Node :: Item ( it) => match it. kind {
4805- ItemKind :: TyAlias ( _, ty , _ )
4806- | ItemKind :: Static ( _, ty , _ , _)
4807- | ItemKind :: Const ( _, ty , _ , _) => Some ( ty) ,
4805+ ItemKind :: TyAlias ( _, _ , ty )
4806+ | ItemKind :: Static ( _, _ , ty , _)
4807+ | ItemKind :: Const ( _, _ , ty , _) => Some ( ty) ,
48084808 ItemKind :: Impl ( impl_item) => Some ( & impl_item. self_ty ) ,
48094809 _ => None ,
48104810 } ,
@@ -4824,7 +4824,7 @@ impl<'hir> Node<'hir> {
48244824
48254825 pub fn alias_ty ( self ) -> Option < & ' hir Ty < ' hir > > {
48264826 match self {
4827- Node :: Item ( Item { kind : ItemKind :: TyAlias ( _, ty , _ ) , .. } ) => Some ( ty) ,
4827+ Node :: Item ( Item { kind : ItemKind :: TyAlias ( _, _ , ty ) , .. } ) => Some ( ty) ,
48284828 _ => None ,
48294829 }
48304830 }
0 commit comments