@@ -384,8 +384,8 @@ impl<'a> LoweringContext<'a> {
384384
385385 if item_lowered {
386386 let item_generics = match self . lctx . items . get ( & item. id ) . unwrap ( ) . node {
387- hir:: Item_ :: ItemImpl ( _, _, _, ref generics, ..)
388- | hir:: Item_ :: ItemTrait ( _, _, ref generics, ..) => {
387+ hir:: ItemKind :: Impl ( _, _, _, ref generics, ..)
388+ | hir:: ItemKind :: Trait ( _, _, ref generics, ..) => {
389389 generics. params . clone ( )
390390 }
391391 _ => HirVec :: new ( ) ,
@@ -1274,7 +1274,7 @@ impl<'a> LoweringContext<'a> {
12741274 ) ;
12751275
12761276 self . with_hir_id_owner ( exist_ty_node_id, |lctx| {
1277- let exist_ty_item_kind = hir:: ItemExistential ( hir:: ExistTy {
1277+ let exist_ty_item_kind = hir:: ItemKind :: Existential ( hir:: ExistTy {
12781278 generics : hir:: Generics {
12791279 params : lifetime_defs,
12801280 where_clause : hir:: WhereClause {
@@ -2575,9 +2575,9 @@ impl<'a> LoweringContext<'a> {
25752575 attrs : & hir:: HirVec < Attribute > ,
25762576 vis : & mut hir:: Visibility ,
25772577 i : & ItemKind ,
2578- ) -> hir:: Item_ {
2578+ ) -> hir:: ItemKind {
25792579 match * i {
2580- ItemKind :: ExternCrate ( orig_name) => hir:: ItemExternCrate ( orig_name) ,
2580+ ItemKind :: ExternCrate ( orig_name) => hir:: ItemKind :: ExternCrate ( orig_name) ,
25812581 ItemKind :: Use ( ref use_tree) => {
25822582 // Start with an empty prefix
25832583 let prefix = Path {
@@ -2589,15 +2589,15 @@ impl<'a> LoweringContext<'a> {
25892589 }
25902590 ItemKind :: Static ( ref t, m, ref e) => {
25912591 let value = self . lower_body ( None , |this| this. lower_expr ( e) ) ;
2592- hir:: ItemStatic (
2592+ hir:: ItemKind :: Static (
25932593 self . lower_ty ( t, ImplTraitContext :: Disallowed ) ,
25942594 self . lower_mutability ( m) ,
25952595 value,
25962596 )
25972597 }
25982598 ItemKind :: Const ( ref t, ref e) => {
25992599 let value = self . lower_body ( None , |this| this. lower_expr ( e) ) ;
2600- hir:: ItemConst ( self . lower_ty ( t, ImplTraitContext :: Disallowed ) , value)
2600+ hir:: ItemKind :: Const ( self . lower_ty ( t, ImplTraitContext :: Disallowed ) , value)
26012601 }
26022602 ItemKind :: Fn ( ref decl, header, ref generics, ref body) => {
26032603 let fn_def_id = self . resolver . definitions ( ) . local_def_id ( id) ;
@@ -2617,22 +2617,22 @@ impl<'a> LoweringContext<'a> {
26172617 decl, Some ( ( fn_def_id, idty) ) , true , header. asyncness . opt_return_id ( ) ) ,
26182618 ) ;
26192619
2620- hir:: ItemFn (
2620+ hir:: ItemKind :: Fn (
26212621 fn_decl,
26222622 this. lower_fn_header ( header) ,
26232623 generics,
26242624 body_id,
26252625 )
26262626 } )
26272627 }
2628- ItemKind :: Mod ( ref m) => hir:: ItemMod ( self . lower_mod ( m) ) ,
2629- ItemKind :: ForeignMod ( ref nm) => hir:: ItemForeignMod ( self . lower_foreign_mod ( nm) ) ,
2630- ItemKind :: GlobalAsm ( ref ga) => hir:: ItemGlobalAsm ( self . lower_global_asm ( ga) ) ,
2631- ItemKind :: Ty ( ref t, ref generics) => hir:: ItemTy (
2628+ ItemKind :: Mod ( ref m) => hir:: ItemKind :: Mod ( self . lower_mod ( m) ) ,
2629+ ItemKind :: ForeignMod ( ref nm) => hir:: ItemKind :: ForeignMod ( self . lower_foreign_mod ( nm) ) ,
2630+ ItemKind :: GlobalAsm ( ref ga) => hir:: ItemKind :: GlobalAsm ( self . lower_global_asm ( ga) ) ,
2631+ ItemKind :: Ty ( ref t, ref generics) => hir:: ItemKind :: Ty (
26322632 self . lower_ty ( t, ImplTraitContext :: Disallowed ) ,
26332633 self . lower_generics ( generics, ImplTraitContext :: Disallowed ) ,
26342634 ) ,
2635- ItemKind :: Enum ( ref enum_definition, ref generics) => hir:: ItemEnum (
2635+ ItemKind :: Enum ( ref enum_definition, ref generics) => hir:: ItemKind :: Enum (
26362636 hir:: EnumDef {
26372637 variants : enum_definition
26382638 . variants
@@ -2644,14 +2644,14 @@ impl<'a> LoweringContext<'a> {
26442644 ) ,
26452645 ItemKind :: Struct ( ref struct_def, ref generics) => {
26462646 let struct_def = self . lower_variant_data ( struct_def) ;
2647- hir:: ItemStruct (
2647+ hir:: ItemKind :: Struct (
26482648 struct_def,
26492649 self . lower_generics ( generics, ImplTraitContext :: Disallowed ) ,
26502650 )
26512651 }
26522652 ItemKind :: Union ( ref vdata, ref generics) => {
26532653 let vdata = self . lower_variant_data ( vdata) ;
2654- hir:: ItemUnion (
2654+ hir:: ItemKind :: Union (
26552655 vdata,
26562656 self . lower_generics ( generics, ImplTraitContext :: Disallowed ) ,
26572657 )
@@ -2711,7 +2711,7 @@ impl<'a> LoweringContext<'a> {
27112711 } ,
27122712 ) ;
27132713
2714- hir:: ItemImpl (
2714+ hir:: ItemKind :: Impl (
27152715 self . lower_unsafety ( unsafety) ,
27162716 self . lower_impl_polarity ( polarity) ,
27172717 self . lower_defaultness ( defaultness, true /* [1] */ ) ,
@@ -2727,15 +2727,15 @@ impl<'a> LoweringContext<'a> {
27272727 . iter ( )
27282728 . map ( |item| self . lower_trait_item_ref ( item) )
27292729 . collect ( ) ;
2730- hir:: ItemTrait (
2730+ hir:: ItemKind :: Trait (
27312731 self . lower_is_auto ( is_auto) ,
27322732 self . lower_unsafety ( unsafety) ,
27332733 self . lower_generics ( generics, ImplTraitContext :: Disallowed ) ,
27342734 bounds,
27352735 items,
27362736 )
27372737 }
2738- ItemKind :: TraitAlias ( ref generics, ref bounds) => hir:: ItemTraitAlias (
2738+ ItemKind :: TraitAlias ( ref generics, ref bounds) => hir:: ItemKind :: TraitAlias (
27392739 self . lower_generics ( generics, ImplTraitContext :: Disallowed ) ,
27402740 self . lower_param_bounds ( bounds, ImplTraitContext :: Disallowed ) ,
27412741 ) ,
@@ -2754,7 +2754,7 @@ impl<'a> LoweringContext<'a> {
27542754 vis : & mut hir:: Visibility ,
27552755 name : & mut Name ,
27562756 attrs : & hir:: HirVec < Attribute > ,
2757- ) -> hir:: Item_ {
2757+ ) -> hir:: ItemKind {
27582758 let path = & tree. prefix ;
27592759
27602760 match tree. kind {
@@ -2804,7 +2804,7 @@ impl<'a> LoweringContext<'a> {
28042804 self . with_hir_id_owner ( new_node_id, |this| {
28052805 let new_id = this. lower_node_id ( new_node_id) ;
28062806 let path = this. lower_path_extra ( def, & path, None , ParamMode :: Explicit ) ;
2807- let item = hir:: ItemUse ( P ( path) , hir:: UseKind :: Single ) ;
2807+ let item = hir:: ItemKind :: Use ( P ( path) , hir:: UseKind :: Single ) ;
28082808 let vis_kind = match vis. node {
28092809 hir:: VisibilityKind :: Public => hir:: VisibilityKind :: Public ,
28102810 hir:: VisibilityKind :: Crate ( sugar) => hir:: VisibilityKind :: Crate ( sugar) ,
@@ -2835,7 +2835,7 @@ impl<'a> LoweringContext<'a> {
28352835 }
28362836
28372837 let path = P ( self . lower_path_extra ( ret_def, & path, None , ParamMode :: Explicit ) ) ;
2838- hir:: ItemUse ( path, hir:: UseKind :: Single )
2838+ hir:: ItemKind :: Use ( path, hir:: UseKind :: Single )
28392839 }
28402840 UseTreeKind :: Glob => {
28412841 let path = P ( self . lower_path (
@@ -2851,7 +2851,7 @@ impl<'a> LoweringContext<'a> {
28512851 } ,
28522852 ParamMode :: Explicit ,
28532853 ) ) ;
2854- hir:: ItemUse ( path, hir:: UseKind :: Glob )
2854+ hir:: ItemKind :: Use ( path, hir:: UseKind :: Glob )
28552855 }
28562856 UseTreeKind :: Nested ( ref trees) => {
28572857 let prefix = Path {
@@ -2912,7 +2912,7 @@ impl<'a> LoweringContext<'a> {
29122912 // a re-export by accident when `pub`, e.g. in documentation.
29132913 let path = P ( self . lower_path ( id, & prefix, ParamMode :: Explicit ) ) ;
29142914 * vis = respan ( prefix. span . shrink_to_lo ( ) , hir:: VisibilityKind :: Inherited ) ;
2915- hir:: ItemUse ( path, hir:: UseKind :: ListStem )
2915+ hir:: ItemKind :: Use ( path, hir:: UseKind :: ListStem )
29162916 }
29172917 }
29182918 }
0 commit comments