File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -1426,15 +1426,25 @@ fn normalize<'tcx>(cx: &mut DocContext<'tcx>, ty: Ty<'_>) -> Option<Ty<'tcx>> {
1426
1426
return None ;
1427
1427
}
1428
1428
1429
+ use crate :: rustc_trait_selection:: infer:: TyCtxtInferExt ;
1430
+ use crate :: rustc_trait_selection:: traits:: query:: normalize:: AtExt ;
1431
+ use rustc_middle:: traits:: ObligationCause ;
1432
+
1429
1433
// Try to normalize `<X as Y>::T` to a type
1430
1434
let lifted = ty. lift_to_tcx ( cx. tcx ) . unwrap ( ) ;
1431
- match cx. tcx . try_normalize_erasing_regions ( cx. param_env , lifted) {
1435
+ let normalized = cx. tcx . infer_ctxt ( ) . enter ( |infcx| {
1436
+ infcx
1437
+ . at ( & ObligationCause :: dummy ( ) , cx. param_env )
1438
+ . normalize ( lifted)
1439
+ . map ( |resolved| infcx. resolve_vars_if_possible ( resolved. value ) )
1440
+ } ) ;
1441
+ match normalized {
1432
1442
Ok ( normalized_value) => {
1433
- trace ! ( "normalized {:?} to {:?}" , ty, normalized_value) ;
1443
+ debug ! ( "normalized {:?} to {:?}" , ty, normalized_value) ;
1434
1444
Some ( normalized_value)
1435
1445
}
1436
1446
Err ( err) => {
1437
- info ! ( "failed to normalize {:?}: {:?}" , ty, err) ;
1447
+ debug ! ( "failed to normalize {:?}: {:?}" , ty, err) ;
1438
1448
None
1439
1449
}
1440
1450
}
You can’t perform that action at this time.
0 commit comments