@@ -683,9 +683,15 @@ impl<'a> LoweringContext<'a> {
683
683
// Get the name we'll use to make the def-path. Note
684
684
// that collisions are ok here and this shouldn't
685
685
// really show up for end-user.
686
- let str_name = match hir_name {
687
- ParamName :: Plain ( ident) => ident. as_interned_str ( ) ,
688
- ParamName :: Fresh ( _) => keywords:: UnderscoreLifetime . name ( ) . as_interned_str ( ) ,
686
+ let ( str_name, kind) = match hir_name {
687
+ ParamName :: Plain ( ident) => (
688
+ ident. as_interned_str ( ) ,
689
+ hir:: LifetimeParamKind :: InBand ,
690
+ ) ,
691
+ ParamName :: Fresh ( _) => (
692
+ keywords:: UnderscoreLifetime . name ( ) . as_interned_str ( ) ,
693
+ hir:: LifetimeParamKind :: Elided ,
694
+ ) ,
689
695
} ;
690
696
691
697
// Add a definition for the in-band lifetime def
@@ -705,7 +711,7 @@ impl<'a> LoweringContext<'a> {
705
711
bounds : hir_vec ! [ ] ,
706
712
span,
707
713
pure_wrt_drop : false ,
708
- kind : hir:: GenericParamKind :: Lifetime { in_band : true }
714
+ kind : hir:: GenericParamKind :: Lifetime { kind }
709
715
}
710
716
} )
711
717
. chain ( in_band_ty_params. into_iter ( ) )
@@ -1452,11 +1458,15 @@ impl<'a> LoweringContext<'a> {
1452
1458
lifetime. span ,
1453
1459
) ;
1454
1460
1455
- let name = match name {
1456
- hir:: LifetimeName :: Underscore => {
1457
- hir:: ParamName :: Plain ( keywords:: UnderscoreLifetime . ident ( ) )
1458
- }
1459
- hir:: LifetimeName :: Param ( param_name) => param_name,
1461
+ let ( name, kind) = match name {
1462
+ hir:: LifetimeName :: Underscore => (
1463
+ hir:: ParamName :: Plain ( keywords:: UnderscoreLifetime . ident ( ) ) ,
1464
+ hir:: LifetimeParamKind :: Elided ,
1465
+ ) ,
1466
+ hir:: LifetimeName :: Param ( param_name) => (
1467
+ param_name,
1468
+ hir:: LifetimeParamKind :: Explicit ,
1469
+ ) ,
1460
1470
_ => bug ! ( "expected LifetimeName::Param or ParamName::Plain" ) ,
1461
1471
} ;
1462
1472
@@ -1467,9 +1477,7 @@ impl<'a> LoweringContext<'a> {
1467
1477
pure_wrt_drop : false ,
1468
1478
attrs : hir_vec ! [ ] ,
1469
1479
bounds : hir_vec ! [ ] ,
1470
- kind : hir:: GenericParamKind :: Lifetime {
1471
- in_band : false ,
1472
- }
1480
+ kind : hir:: GenericParamKind :: Lifetime { kind }
1473
1481
} ) ;
1474
1482
}
1475
1483
}
@@ -2283,7 +2291,9 @@ impl<'a> LoweringContext<'a> {
2283
2291
pure_wrt_drop : attr:: contains_name ( & param. attrs , "may_dangle" ) ,
2284
2292
attrs : self . lower_attrs ( & param. attrs ) ,
2285
2293
bounds,
2286
- kind : hir:: GenericParamKind :: Lifetime { in_band : false }
2294
+ kind : hir:: GenericParamKind :: Lifetime {
2295
+ kind : hir:: LifetimeParamKind :: Explicit ,
2296
+ }
2287
2297
} ;
2288
2298
2289
2299
self . is_collecting_in_band_lifetimes = was_collecting_in_band;
0 commit comments