@@ -7,7 +7,6 @@ use hir::definitions::DefPathData;
77use rustc_ast:: ptr:: P ;
88use rustc_ast:: visit:: AssocCtxt ;
99use rustc_ast:: * ;
10- use rustc_data_structures:: sorted_map:: SortedMap ;
1110use rustc_errors:: ErrorGuaranteed ;
1211use rustc_hir as hir;
1312use rustc_hir:: def:: { DefKind , Res } ;
@@ -55,42 +54,7 @@ impl<'a, 'hir> ItemLowerer<'a, 'hir> {
5554 owner : NodeId ,
5655 f : impl FnOnce ( & mut LoweringContext < ' _ , ' hir > ) -> hir:: OwnerNode < ' hir > ,
5756 ) {
58- let allow_gen_future = Some ( if self . tcx . features ( ) . async_fn_track_caller {
59- [ sym:: gen_future, sym:: closure_track_caller] [ ..] . into ( )
60- } else {
61- [ sym:: gen_future] [ ..] . into ( )
62- } ) ;
63- let mut lctx = LoweringContext {
64- // Pseudo-globals.
65- tcx : self . tcx ,
66- resolver : self . resolver ,
67- arena : self . tcx . hir_arena ,
68-
69- // HirId handling.
70- bodies : Vec :: new ( ) ,
71- attrs : SortedMap :: default ( ) ,
72- children : Vec :: default ( ) ,
73- current_hir_id_owner : hir:: CRATE_OWNER_ID ,
74- item_local_id_counter : hir:: ItemLocalId :: new ( 0 ) ,
75- node_id_to_local_id : Default :: default ( ) ,
76- trait_map : Default :: default ( ) ,
77-
78- // Lowering state.
79- catch_scope : None ,
80- loop_scope : None ,
81- is_in_loop_condition : false ,
82- is_in_trait_impl : false ,
83- is_in_dyn_type : false ,
84- coroutine_kind : None ,
85- task_context : None ,
86- current_item : None ,
87- impl_trait_defs : Vec :: new ( ) ,
88- impl_trait_bounds : Vec :: new ( ) ,
89- allow_try_trait : Some ( [ sym:: try_trait_v2, sym:: yeet_desugar_details] [ ..] . into ( ) ) ,
90- allow_gen_future,
91- generics_def_id_map : Default :: default ( ) ,
92- host_param_id : None ,
93- } ;
57+ let mut lctx = LoweringContext :: new ( self . tcx , self . resolver ) ;
9458 lctx. with_hir_id_owner ( owner, |lctx| f ( lctx) ) ;
9559
9660 for ( def_id, info) in lctx. children {
0 commit comments