@@ -55,7 +55,7 @@ use rustc_hir::definitions::PerParentDisambiguatorState;
5555use rustc_hir:: lints:: DelayedLint ;
5656use rustc_hir:: {
5757 self as hir, AngleBrackets , ConstArg , GenericArg , HirId , ItemLocalMap , LifetimeSource ,
58- LifetimeSyntax , ParamName , Target , TraitCandidate , find_attr,
58+ LifetimeSyntax , MissingLifetimeKind , ParamName , Target , TraitCandidate , find_attr,
5959} ;
6060use rustc_index:: { Idx , IndexSlice , IndexVec } ;
6161use rustc_macros:: extension;
@@ -310,7 +310,7 @@ impl<'tcx> ResolverAstLowering<'tcx> {
310310 ///
311311 /// The extra lifetimes that appear from the parenthesized `Fn`-trait desugaring
312312 /// should appear at the enclosing `PolyTraitRef`.
313- fn extra_lifetime_params ( & self , id : NodeId ) -> & [ ( Ident , NodeId , LifetimeRes ) ] {
313+ fn extra_lifetime_params ( & self , id : NodeId ) -> & [ ( Ident , NodeId , MissingLifetimeKind ) ] {
314314 self . extra_lifetime_params_map . get ( & id) . map_or ( & [ ] , |v| & v[ ..] )
315315 }
316316
@@ -948,36 +948,27 @@ impl<'hir> LoweringContext<'_, 'hir> {
948948 & mut self ,
949949 ident : Ident ,
950950 node_id : NodeId ,
951- res : LifetimeRes ,
951+ kind : MissingLifetimeKind ,
952952 source : hir:: GenericParamSource ,
953953 ) -> hir:: GenericParam < ' hir > {
954- let ( name, kind) = match res {
955- LifetimeRes :: Fresh { param, kind, .. } => {
956- // Late resolution delegates to us the creation of the `LocalDefId`.
957- let _def_id = self . create_def (
958- param,
959- Some ( kw:: UnderscoreLifetime ) ,
960- DefKind :: LifetimeParam ,
961- ident. span ,
962- ) ;
963- debug ! ( ?_def_id) ;
954+ // Late resolution delegates to us the creation of the `LocalDefId`.
955+ let _def_id = self . create_def (
956+ node_id,
957+ Some ( kw:: UnderscoreLifetime ) ,
958+ DefKind :: LifetimeParam ,
959+ ident. span ,
960+ ) ;
961+ debug ! ( ?_def_id) ;
964962
965- ( hir:: ParamName :: Fresh , hir:: LifetimeParamKind :: Elided ( kind) )
966- }
967- res => panic ! (
968- "Unexpected lifetime resolution {:?} for {:?} at {:?}" ,
969- res, ident, ident. span
970- ) ,
971- } ;
972963 let hir_id = self . lower_node_id ( node_id) ;
973964 let def_id = self . local_def_id ( node_id) ;
974965 hir:: GenericParam {
975966 hir_id,
976967 def_id,
977- name,
968+ name : hir :: ParamName :: Fresh ,
978969 span : self . lower_span ( ident. span ) ,
979970 pure_wrt_drop : false ,
980- kind : hir:: GenericParamKind :: Lifetime { kind } ,
971+ kind : hir:: GenericParamKind :: Lifetime { kind : hir :: LifetimeParamKind :: Elided ( kind ) } ,
981972 colon_span : None ,
982973 source,
983974 }
0 commit comments