@@ -145,7 +145,7 @@ impl FromWithTcx<clean::GenericArg> for GenericArg {
145
145
fn from_tcx ( arg : clean:: GenericArg , tcx : TyCtxt < ' _ > ) -> Self {
146
146
use clean:: GenericArg :: * ;
147
147
match arg {
148
- Lifetime ( l) => GenericArg :: Lifetime ( l . 0 . to_string ( ) ) ,
148
+ Lifetime ( l) => GenericArg :: Lifetime ( convert_lifetime ( l ) ) ,
149
149
Type ( t) => GenericArg :: Type ( t. into_tcx ( tcx) ) ,
150
150
Const ( box c) => GenericArg :: Const ( c. into_tcx ( tcx) ) ,
151
151
Infer => GenericArg :: Infer ,
@@ -347,6 +347,10 @@ fn convert_abi(a: RustcAbi) -> Abi {
347
347
}
348
348
}
349
349
350
+ fn convert_lifetime ( l : clean:: Lifetime ) -> String {
351
+ l. 0 . to_string ( )
352
+ }
353
+
350
354
impl FromWithTcx < clean:: Generics > for Generics {
351
355
fn from_tcx ( generics : clean:: Generics , tcx : TyCtxt < ' _ > ) -> Self {
352
356
Generics {
@@ -374,7 +378,7 @@ impl FromWithTcx<clean::GenericParamDefKind> for GenericParamDefKind {
374
378
use clean:: GenericParamDefKind :: * ;
375
379
match kind {
376
380
Lifetime { outlives } => GenericParamDefKind :: Lifetime {
377
- outlives : outlives. into_iter ( ) . map ( |lt| lt . 0 . to_string ( ) ) . collect ( ) ,
381
+ outlives : outlives. into_iter ( ) . map ( convert_lifetime ) . collect ( ) ,
378
382
} ,
379
383
Type { did : _, bounds, default, synthetic } => GenericParamDefKind :: Type {
380
384
bounds : bounds. into_iter ( ) . map ( |x| x. into_tcx ( tcx) ) . collect ( ) ,
@@ -405,7 +409,7 @@ impl FromWithTcx<clean::WherePredicate> for WherePredicate {
405
409
. collect ( ) ,
406
410
} ,
407
411
RegionPredicate { lifetime, bounds } => WherePredicate :: RegionPredicate {
408
- lifetime : lifetime . 0 . to_string ( ) ,
412
+ lifetime : convert_lifetime ( lifetime )
409
413
bounds: bounds. into_iter ( ) . map ( |x| x. into_tcx ( tcx) ) . collect ( ) ,
410
414
} ,
411
415
EqPredicate { lhs, rhs } => {
@@ -428,7 +432,7 @@ impl FromWithTcx<clean::GenericBound> for GenericBound {
428
432
modifier : from_trait_bound_modifier ( modifier) ,
429
433
}
430
434
}
431
- Outlives ( lifetime) => GenericBound :: Outlives ( lifetime . 0 . to_string ( ) ) ,
435
+ Outlives ( lifetime) => GenericBound :: Outlives ( convert_lifetime ( lifetime ) ) ,
432
436
}
433
437
}
434
438
}
@@ -459,7 +463,7 @@ impl FromWithTcx<clean::Type> for Type {
459
463
param_names : Vec :: new ( ) ,
460
464
} ,
461
465
clean:: Type :: DynTrait ( bounds, lt) => Type :: DynTrait ( DynTrait {
462
- lifetime : lt. map ( |lt| lt . 0 . to_string ( ) ) ,
466
+ lifetime : lt. map ( convert_lifetime ) ,
463
467
traits : bounds. into_iter ( ) . map ( |t| t. into_tcx ( tcx) ) . collect ( ) ,
464
468
} ) ,
465
469
Generic ( s) => Type :: Generic ( s. to_string ( ) ) ,
@@ -475,7 +479,7 @@ impl FromWithTcx<clean::Type> for Type {
475
479
type_ : Box :: new ( ( * type_) . into_tcx ( tcx) ) ,
476
480
} ,
477
481
BorrowedRef { lifetime, mutability, type_ } => Type :: BorrowedRef {
478
- lifetime : lifetime. map ( |l| l . 0 . to_string ( ) ) ,
482
+ lifetime : lifetime. map ( convert_lifetime ) ,
479
483
mutable : mutability == ast:: Mutability :: Mut ,
480
484
type_ : Box :: new ( ( * type_) . into_tcx ( tcx) ) ,
481
485
} ,
0 commit comments