@@ -686,7 +686,7 @@ impl<'a> LoweringContext<'a> {
686686 f : F ,
687687 ) -> ( Vec < hir:: GenericParam > , T )
688688 where
689- F : FnOnce ( & mut LoweringContext ) -> ( Vec < hir:: GenericParam > , T ) ,
689+ F : FnOnce ( & mut LoweringContext < ' _ > ) -> ( Vec < hir:: GenericParam > , T ) ,
690690 {
691691 assert ! ( !self . is_collecting_in_band_lifetimes) ;
692692 assert ! ( self . lifetimes_to_define. is_empty( ) ) ;
@@ -788,7 +788,7 @@ impl<'a> LoweringContext<'a> {
788788 // for them.
789789 fn with_in_scope_lifetime_defs < T , F > ( & mut self , params : & [ GenericParam ] , f : F ) -> T
790790 where
791- F : FnOnce ( & mut LoweringContext ) -> T ,
791+ F : FnOnce ( & mut LoweringContext < ' _ > ) -> T ,
792792 {
793793 let old_len = self . in_scope_lifetimes . len ( ) ;
794794 let lt_def_names = params. iter ( ) . filter_map ( |param| match param. kind {
@@ -812,7 +812,7 @@ impl<'a> LoweringContext<'a> {
812812 params : & HirVec < hir:: GenericParam > ,
813813 f : F
814814 ) -> T where
815- F : FnOnce ( & mut LoweringContext ) -> T ,
815+ F : FnOnce ( & mut LoweringContext < ' _ > ) -> T ,
816816 {
817817 let old_len = self . in_scope_lifetimes . len ( ) ;
818818 let lt_def_names = params. iter ( ) . filter_map ( |param| match param. kind {
@@ -841,7 +841,7 @@ impl<'a> LoweringContext<'a> {
841841 f : F ,
842842 ) -> ( hir:: Generics , T )
843843 where
844- F : FnOnce ( & mut LoweringContext , & mut Vec < hir:: GenericParam > ) -> T ,
844+ F : FnOnce ( & mut LoweringContext < ' _ > , & mut Vec < hir:: GenericParam > ) -> T ,
845845 {
846846 let ( in_band_defs, ( mut lowered_generics, res) ) = self . with_in_scope_lifetime_defs (
847847 & generics. params ,
@@ -870,7 +870,7 @@ impl<'a> LoweringContext<'a> {
870870
871871 fn with_catch_scope < T , F > ( & mut self , catch_id : NodeId , f : F ) -> T
872872 where
873- F : FnOnce ( & mut LoweringContext ) -> T ,
873+ F : FnOnce ( & mut LoweringContext < ' _ > ) -> T ,
874874 {
875875 let len = self . catch_scopes . len ( ) ;
876876 self . catch_scopes . push ( catch_id) ;
@@ -892,7 +892,7 @@ impl<'a> LoweringContext<'a> {
892892 capture_clause : CaptureBy ,
893893 closure_node_id : NodeId ,
894894 ret_ty : Option < & Ty > ,
895- body : impl FnOnce ( & mut LoweringContext ) -> hir:: Expr ,
895+ body : impl FnOnce ( & mut LoweringContext < ' _ > ) -> hir:: Expr ,
896896 ) -> hir:: ExprKind {
897897 let prev_is_generator = mem:: replace ( & mut self . is_generator , true ) ;
898898 let body_expr = body ( self ) ;
@@ -929,7 +929,7 @@ impl<'a> LoweringContext<'a> {
929929
930930 fn lower_body < F > ( & mut self , decl : Option < & FnDecl > , f : F ) -> hir:: BodyId
931931 where
932- F : FnOnce ( & mut LoweringContext ) -> hir:: Expr ,
932+ F : FnOnce ( & mut LoweringContext < ' _ > ) -> hir:: Expr ,
933933 {
934934 let prev = mem:: replace ( & mut self . is_generator , false ) ;
935935 let result = f ( self ) ;
@@ -940,7 +940,7 @@ impl<'a> LoweringContext<'a> {
940940
941941 fn with_loop_scope < T , F > ( & mut self , loop_id : NodeId , f : F ) -> T
942942 where
943- F : FnOnce ( & mut LoweringContext ) -> T ,
943+ F : FnOnce ( & mut LoweringContext < ' _ > ) -> T ,
944944 {
945945 // We're no longer in the base loop's condition; we're in another loop.
946946 let was_in_loop_condition = self . is_in_loop_condition ;
@@ -965,7 +965,7 @@ impl<'a> LoweringContext<'a> {
965965
966966 fn with_loop_condition_scope < T , F > ( & mut self , f : F ) -> T
967967 where
968- F : FnOnce ( & mut LoweringContext ) -> T ,
968+ F : FnOnce ( & mut LoweringContext < ' _ > ) -> T ,
969969 {
970970 let was_in_loop_condition = self . is_in_loop_condition ;
971971 self . is_in_loop_condition = true ;
@@ -979,7 +979,7 @@ impl<'a> LoweringContext<'a> {
979979
980980 fn with_new_scopes < T , F > ( & mut self , f : F ) -> T
981981 where
982- F : FnOnce ( & mut LoweringContext ) -> T ,
982+ F : FnOnce ( & mut LoweringContext < ' _ > ) -> T ,
983983 {
984984 let was_in_loop_condition = self . is_in_loop_condition ;
985985 self . is_in_loop_condition = false ;
@@ -1094,7 +1094,8 @@ impl<'a> LoweringContext<'a> {
10941094 }
10951095 }
10961096
1097- fn lower_ty_binding ( & mut self , b : & TypeBinding , itctx : ImplTraitContext ) -> hir:: TypeBinding {
1097+ fn lower_ty_binding ( & mut self , b : & TypeBinding ,
1098+ itctx : ImplTraitContext < ' _ > ) -> hir:: TypeBinding {
10981099 hir:: TypeBinding {
10991100 id : self . lower_node_id ( b. id ) . node_id ,
11001101 ident : b. ident ,
@@ -1105,19 +1106,19 @@ impl<'a> LoweringContext<'a> {
11051106
11061107 fn lower_generic_arg ( & mut self ,
11071108 arg : & ast:: GenericArg ,
1108- itctx : ImplTraitContext )
1109+ itctx : ImplTraitContext < ' _ > )
11091110 -> hir:: GenericArg {
11101111 match arg {
11111112 ast:: GenericArg :: Lifetime ( lt) => GenericArg :: Lifetime ( self . lower_lifetime ( & lt) ) ,
11121113 ast:: GenericArg :: Type ( ty) => GenericArg :: Type ( self . lower_ty_direct ( & ty, itctx) ) ,
11131114 }
11141115 }
11151116
1116- fn lower_ty ( & mut self , t : & Ty , itctx : ImplTraitContext ) -> P < hir:: Ty > {
1117+ fn lower_ty ( & mut self , t : & Ty , itctx : ImplTraitContext < ' _ > ) -> P < hir:: Ty > {
11171118 P ( self . lower_ty_direct ( t, itctx) )
11181119 }
11191120
1120- fn lower_ty_direct ( & mut self , t : & Ty , mut itctx : ImplTraitContext ) -> hir:: Ty {
1121+ fn lower_ty_direct ( & mut self , t : & Ty , mut itctx : ImplTraitContext < ' _ > ) -> hir:: Ty {
11211122 let kind = match t. node {
11221123 TyKind :: Infer => hir:: TyKind :: Infer ,
11231124 TyKind :: Err => hir:: TyKind :: Err ,
@@ -1289,7 +1290,7 @@ impl<'a> LoweringContext<'a> {
12891290 span : Span ,
12901291 fn_def_id : Option < DefId > ,
12911292 exist_ty_node_id : NodeId ,
1292- lower_bounds : impl FnOnce ( & mut LoweringContext ) -> hir:: GenericBounds ,
1293+ lower_bounds : impl FnOnce ( & mut LoweringContext < ' _ > ) -> hir:: GenericBounds ,
12931294 ) -> hir:: TyKind {
12941295 // Make sure we know that some funky desugaring has been going on here.
12951296 // This is a first: there is code in other places like for loop
@@ -1567,7 +1568,7 @@ impl<'a> LoweringContext<'a> {
15671568 qself : & Option < QSelf > ,
15681569 p : & Path ,
15691570 param_mode : ParamMode ,
1570- mut itctx : ImplTraitContext ,
1571+ mut itctx : ImplTraitContext < ' _ > ,
15711572 ) -> hir:: QPath {
15721573 let qself_position = qself. as_ref ( ) . map ( |q| q. position ) ;
15731574 let qself = qself. as_ref ( ) . map ( |q| self . lower_ty ( & q. ty , itctx. reborrow ( ) ) ) ;
@@ -1762,7 +1763,7 @@ impl<'a> LoweringContext<'a> {
17621763 param_mode : ParamMode ,
17631764 expected_lifetimes : usize ,
17641765 parenthesized_generic_args : ParenthesizedGenericArgs ,
1765- itctx : ImplTraitContext ,
1766+ itctx : ImplTraitContext < ' _ > ,
17661767 ) -> hir:: PathSegment {
17671768 let ( mut generic_args, infer_types) = if let Some ( ref generic_args) = segment. args {
17681769 let msg = "parenthesized parameters may only be used with a trait" ;
@@ -1844,7 +1845,7 @@ impl<'a> LoweringContext<'a> {
18441845 & mut self ,
18451846 data : & AngleBracketedArgs ,
18461847 param_mode : ParamMode ,
1847- mut itctx : ImplTraitContext ,
1848+ mut itctx : ImplTraitContext < ' _ > ,
18481849 ) -> ( hir:: GenericArgs , bool ) {
18491850 let & AngleBracketedArgs { ref args, ref bindings, .. } = data;
18501851 let has_types = args. iter ( ) . any ( |arg| match arg {
@@ -1871,7 +1872,7 @@ impl<'a> LoweringContext<'a> {
18711872 self . with_anonymous_lifetime_mode (
18721873 AnonymousLifetimeMode :: PassThrough ,
18731874 |this| {
1874- const DISALLOWED : ImplTraitContext = ImplTraitContext :: Disallowed ;
1875+ const DISALLOWED : ImplTraitContext < ' _ > = ImplTraitContext :: Disallowed ;
18751876 let & ParenthesisedArgs { ref inputs, ref output, span } = data;
18761877 let inputs = inputs. iter ( ) . map ( |ty| this. lower_ty_direct ( ty, DISALLOWED ) ) . collect ( ) ;
18771878 let mk_tup = |this : & mut Self , tys, span| {
@@ -2250,7 +2251,7 @@ impl<'a> LoweringContext<'a> {
22502251 fn lower_param_bound (
22512252 & mut self ,
22522253 tpb : & GenericBound ,
2253- itctx : ImplTraitContext ,
2254+ itctx : ImplTraitContext < ' _ > ,
22542255 ) -> hir:: GenericBound {
22552256 match * tpb {
22562257 GenericBound :: Trait ( ref ty, modifier) => hir:: GenericBound :: Trait (
@@ -2304,7 +2305,7 @@ impl<'a> LoweringContext<'a> {
23042305 & mut self ,
23052306 params : & [ GenericParam ] ,
23062307 add_bounds : & NodeMap < Vec < GenericBound > > ,
2307- mut itctx : ImplTraitContext ,
2308+ mut itctx : ImplTraitContext < ' _ > ,
23082309 ) -> hir:: HirVec < hir:: GenericParam > {
23092310 params. iter ( ) . map ( |param| {
23102311 self . lower_generic_param ( param, add_bounds, itctx. reborrow ( ) )
@@ -2314,7 +2315,7 @@ impl<'a> LoweringContext<'a> {
23142315 fn lower_generic_param ( & mut self ,
23152316 param : & GenericParam ,
23162317 add_bounds : & NodeMap < Vec < GenericBound > > ,
2317- mut itctx : ImplTraitContext )
2318+ mut itctx : ImplTraitContext < ' _ > )
23182319 -> hir:: GenericParam {
23192320 let mut bounds = self . lower_param_bounds ( & param. bounds , itctx. reborrow ( ) ) ;
23202321 match param. kind {
@@ -2383,7 +2384,7 @@ impl<'a> LoweringContext<'a> {
23832384 fn lower_generics (
23842385 & mut self ,
23852386 generics : & Generics ,
2386- itctx : ImplTraitContext )
2387+ itctx : ImplTraitContext < ' _ > )
23872388 -> hir:: Generics
23882389 {
23892390 // Collect `?Trait` bounds in where clause and move them to parameter definitions.
@@ -2536,7 +2537,7 @@ impl<'a> LoweringContext<'a> {
25362537 }
25372538 }
25382539
2539- fn lower_trait_ref ( & mut self , p : & TraitRef , itctx : ImplTraitContext ) -> hir:: TraitRef {
2540+ fn lower_trait_ref ( & mut self , p : & TraitRef , itctx : ImplTraitContext < ' _ > ) -> hir:: TraitRef {
25402541 let path = match self . lower_qpath ( p. ref_id , & None , & p. path , ParamMode :: Explicit , itctx) {
25412542 hir:: QPath :: Resolved ( None , path) => path. and_then ( |path| path) ,
25422543 qpath => bug ! ( "lower_trait_ref: unexpected QPath `{:?}`" , qpath) ,
@@ -2552,7 +2553,7 @@ impl<'a> LoweringContext<'a> {
25522553 fn lower_poly_trait_ref (
25532554 & mut self ,
25542555 p : & PolyTraitRef ,
2555- mut itctx : ImplTraitContext ,
2556+ mut itctx : ImplTraitContext < ' _ > ,
25562557 ) -> hir:: PolyTraitRef {
25572558 let bound_generic_params =
25582559 self . lower_generic_params ( & p. bound_generic_params , & NodeMap ( ) , itctx. reborrow ( ) ) ;
@@ -2593,14 +2594,14 @@ impl<'a> LoweringContext<'a> {
25932594 }
25942595 }
25952596
2596- fn lower_mt ( & mut self , mt : & MutTy , itctx : ImplTraitContext ) -> hir:: MutTy {
2597+ fn lower_mt ( & mut self , mt : & MutTy , itctx : ImplTraitContext < ' _ > ) -> hir:: MutTy {
25972598 hir:: MutTy {
25982599 ty : self . lower_ty ( & mt. ty , itctx) ,
25992600 mutbl : self . lower_mutability ( mt. mutbl ) ,
26002601 }
26012602 }
26022603
2603- fn lower_param_bounds ( & mut self , bounds : & [ GenericBound ] , mut itctx : ImplTraitContext )
2604+ fn lower_param_bounds ( & mut self , bounds : & [ GenericBound ] , mut itctx : ImplTraitContext < ' _ > )
26042605 -> hir:: GenericBounds {
26052606 bounds. iter ( ) . map ( |bound| self . lower_param_bound ( bound, itctx. reborrow ( ) ) ) . collect ( )
26062607 }
0 commit comments