@@ -13,7 +13,7 @@ use rustc_hir::{
1313} ;
1414use rustc_index:: { IndexSlice , IndexVec } ;
1515use rustc_middle:: span_bug;
16- use rustc_middle:: ty:: TyCtxt ;
16+ use rustc_middle:: ty:: { ResolverAstLowering , TyCtxt } ;
1717use rustc_span:: def_id:: DefId ;
1818use rustc_span:: edit_distance:: find_best_match_for_name;
1919use rustc_span:: { DUMMY_SP , DesugaringKind , Ident , Span , Symbol , kw, sym} ;
@@ -48,9 +48,9 @@ impl<'hir> Owners<'_, 'hir> {
4848 }
4949}
5050
51- pub ( super ) struct ItemLowerer < ' a , ' hir , R > {
51+ pub ( super ) struct ItemLowerer < ' a , ' hir > {
5252 pub ( super ) tcx : TyCtxt < ' hir > ,
53- pub ( super ) resolver : & ' a mut R ,
53+ pub ( super ) resolver : & ' hir ResolverAstLowering < ' hir > ,
5454 pub ( super ) ast_index : & ' a IndexSlice < LocalDefId , AstOwner < ' a > > ,
5555 pub ( super ) owners : Owners < ' a , ' hir > ,
5656}
@@ -74,11 +74,11 @@ fn add_ty_alias_where_clause(
7474 if before. 0 || !after. 0 { before } else { after } ;
7575}
7676
77- impl < ' hir , R : ResolverAstLoweringExt < ' hir > > ItemLowerer < ' _ , ' hir , R > {
77+ impl < ' hir > ItemLowerer < ' _ , ' hir > {
7878 fn with_lctx (
7979 & mut self ,
8080 owner : NodeId ,
81- f : impl FnOnce ( & mut LoweringContext < ' _ , ' hir , R > ) -> hir:: OwnerNode < ' hir > ,
81+ f : impl FnOnce ( & mut LoweringContext < ' hir > ) -> hir:: OwnerNode < ' hir > ,
8282 ) {
8383 let mut lctx = LoweringContext :: new ( self . tcx , self . resolver ) ;
8484 lctx. with_hir_id_owner ( owner, |lctx| f ( lctx) ) ;
@@ -122,7 +122,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> ItemLowerer<'_, 'hir, R> {
122122 }
123123}
124124
125- impl < ' hir , R : ResolverAstLoweringExt < ' hir > > LoweringContext < ' _ , ' hir , R > {
125+ impl < ' hir > LoweringContext < ' hir > {
126126 pub ( super ) fn lower_mod (
127127 & mut self ,
128128 items : & [ Box < Item > ] ,
@@ -635,7 +635,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
635635 }
636636
637637 fn lower_path_simple_eii ( & mut self , id : NodeId , path : & Path ) -> Option < DefId > {
638- let res = self . resolver . get_partial_res ( id) ?;
638+ let res = self . get_partial_res ( id) ?;
639639 let Some ( did) = res. expect_full_res ( ) . opt_def_id ( ) else {
640640 self . dcx ( ) . span_delayed_bug ( path. span , "should have errored in resolve" ) ;
641641 return None ;
@@ -1336,7 +1336,6 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
13361336 ImplItemImplKind :: Trait {
13371337 defaultness,
13381338 trait_item_def_id : self
1339- . resolver
13401339 . get_partial_res ( i. id )
13411340 . and_then ( |r| r. expect_full_res ( ) . opt_def_id ( ) )
13421341 . ok_or_else ( || {
@@ -1532,7 +1531,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
15321531 pub ( crate ) fn lower_coroutine_body_with_moved_arguments (
15331532 & mut self ,
15341533 decl : & FnDecl ,
1535- lower_body : impl FnOnce ( & mut LoweringContext < ' _ , ' hir , R > ) -> hir:: Expr < ' hir > ,
1534+ lower_body : impl FnOnce ( & mut LoweringContext < ' hir > ) -> hir:: Expr < ' hir > ,
15361535 fn_decl_span : Span ,
15371536 body_span : Span ,
15381537 coroutine_kind : CoroutineKind ,
@@ -1669,7 +1668,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
16691668 parameters. push ( new_parameter) ;
16701669 }
16711670
1672- let mkbody = |this : & mut LoweringContext < ' _ , ' hir , R > | {
1671+ let mkbody = |this : & mut LoweringContext < ' hir > | {
16731672 // Create a block from the user's function body:
16741673 let user_body = lower_body ( this) ;
16751674
@@ -1854,7 +1853,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
18541853 let kind = match & r. kind {
18551854 RestrictionKind :: Unrestricted => hir:: RestrictionKind :: Unrestricted ,
18561855 RestrictionKind :: Restricted { path, id, shorthand : _ } => {
1857- let res = self . resolver . get_partial_res ( * id) ;
1856+ let res = self . get_partial_res ( * id) ;
18581857 if let Some ( did) = res. and_then ( |res| res. expect_full_res ( ) . opt_def_id ( ) ) {
18591858 hir:: RestrictionKind :: Restricted ( self . arena . alloc ( hir:: Path {
18601859 res : did,
@@ -1920,7 +1919,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
19201919
19211920 // Introduce extra lifetimes if late resolution tells us to.
19221921 let extra_lifetimes = self . resolver . extra_lifetime_params ( parent_node_id) ;
1923- params. extend ( extra_lifetimes. into_iter ( ) . filter_map ( |( ident, node_id, res) | {
1922+ params. extend ( extra_lifetimes. into_iter ( ) . filter_map ( |& ( ident, node_id, res) | {
19241923 self . lifetime_res_to_generic_param (
19251924 ident,
19261925 node_id,
@@ -1962,7 +1961,7 @@ impl<'hir, R: ResolverAstLoweringExt<'hir>> LoweringContext<'_, 'hir, R> {
19621961 return ;
19631962 } ;
19641963 let define_opaque = define_opaque. iter ( ) . filter_map ( |( id, path) | {
1965- let res = self . resolver . get_partial_res ( * id) ;
1964+ let res = self . get_partial_res ( * id) ;
19661965 let Some ( did) = res. and_then ( |res| res. expect_full_res ( ) . opt_def_id ( ) ) else {
19671966 self . dcx ( ) . span_delayed_bug ( path. span , "should have errored in resolve" ) ;
19681967 return None ;
0 commit comments