@@ -268,7 +268,7 @@ fn clean_poly_trait_ref_with_constraints<'tcx>(
268
268
)
269
269
}
270
270
271
- fn clean_lifetime ( lifetime : & hir:: Lifetime , cx : & mut DocContext < ' _ > ) -> Lifetime {
271
+ fn clean_lifetime ( lifetime : & hir:: Lifetime , cx : & DocContext < ' _ > ) -> Lifetime {
272
272
if let Some (
273
273
rbv:: ResolvedArg :: EarlyBound ( did)
274
274
| rbv:: ResolvedArg :: LateBound ( _, _, did)
@@ -362,9 +362,9 @@ pub(crate) fn clean_predicate<'tcx>(
362
362
let bound_predicate = predicate. kind ( ) ;
363
363
match bound_predicate. skip_binder ( ) {
364
364
ty:: ClauseKind :: Trait ( pred) => clean_poly_trait_predicate ( bound_predicate. rebind ( pred) , cx) ,
365
- ty:: ClauseKind :: RegionOutlives ( pred) => clean_region_outlives_predicate ( pred) ,
365
+ ty:: ClauseKind :: RegionOutlives ( pred) => Some ( clean_region_outlives_predicate ( pred) ) ,
366
366
ty:: ClauseKind :: TypeOutlives ( pred) => {
367
- clean_type_outlives_predicate ( bound_predicate. rebind ( pred) , cx)
367
+ Some ( clean_type_outlives_predicate ( bound_predicate. rebind ( pred) , cx) )
368
368
}
369
369
ty:: ClauseKind :: Projection ( pred) => {
370
370
Some ( clean_projection_predicate ( bound_predicate. rebind ( pred) , cx) )
@@ -398,30 +398,30 @@ fn clean_poly_trait_predicate<'tcx>(
398
398
399
399
fn clean_region_outlives_predicate (
400
400
pred : ty:: RegionOutlivesPredicate < ' _ > ,
401
- ) -> Option < WherePredicate > {
401
+ ) -> WherePredicate {
402
402
let ty:: OutlivesPredicate ( a, b) = pred;
403
403
404
- Some ( WherePredicate :: RegionPredicate {
404
+ WherePredicate :: RegionPredicate {
405
405
lifetime : clean_middle_region ( a) . expect ( "failed to clean lifetime" ) ,
406
406
bounds : vec ! [ GenericBound :: Outlives (
407
407
clean_middle_region( b) . expect( "failed to clean bounds" ) ,
408
408
) ] ,
409
- } )
409
+ }
410
410
}
411
411
412
412
fn clean_type_outlives_predicate < ' tcx > (
413
413
pred : ty:: Binder < ' tcx , ty:: TypeOutlivesPredicate < ' tcx > > ,
414
414
cx : & mut DocContext < ' tcx > ,
415
- ) -> Option < WherePredicate > {
415
+ ) -> WherePredicate {
416
416
let ty:: OutlivesPredicate ( ty, lt) = pred. skip_binder ( ) ;
417
417
418
- Some ( WherePredicate :: BoundPredicate {
418
+ WherePredicate :: BoundPredicate {
419
419
ty : clean_middle_ty ( pred. rebind ( ty) , cx, None , None ) ,
420
420
bounds : vec ! [ GenericBound :: Outlives (
421
421
clean_middle_region( lt) . expect( "failed to clean lifetimes" ) ,
422
422
) ] ,
423
423
bound_params : Vec :: new ( ) ,
424
- } )
424
+ }
425
425
}
426
426
427
427
fn clean_middle_term < ' tcx > (
@@ -1860,7 +1860,7 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
1860
1860
1861
1861
/// Returns `None` if the type could not be normalized
1862
1862
fn normalize < ' tcx > (
1863
- cx : & mut DocContext < ' tcx > ,
1863
+ cx : & DocContext < ' tcx > ,
1864
1864
ty : ty:: Binder < ' tcx , Ty < ' tcx > > ,
1865
1865
) -> Option < ty:: Binder < ' tcx , Ty < ' tcx > > > {
1866
1866
// HACK: low-churn fix for #79459 while we wait for a trait normalization fix
0 commit comments