This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Expand file tree Collapse file tree 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>> {
14261426 return None ;
14271427 }
14281428
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+
14291433 // Try to normalize `<X as Y>::T` to a type
14301434 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 {
14321442 Ok ( normalized_value) => {
1433- trace ! ( "normalized {:?} to {:?}" , ty, normalized_value) ;
1443+ debug ! ( "normalized {:?} to {:?}" , ty, normalized_value) ;
14341444 Some ( normalized_value)
14351445 }
14361446 Err ( err) => {
1437- info ! ( "failed to normalize {:?}: {:?}" , ty, err) ;
1447+ debug ! ( "failed to normalize {:?}: {:?}" , ty, err) ;
14381448 None
14391449 }
14401450 }
You can’t perform that action at this time.
0 commit comments