@@ -1741,9 +1741,9 @@ fn maybe_expand_private_type_alias<'tcx>(
17411741 } ;
17421742 let hir:: ItemKind :: TyAlias ( ty, generics) = alias else { return None } ;
17431743
1744- let provided_params = & path. segments . last ( ) . expect ( "segments were empty" ) ;
1744+ let final_seg = & path. segments . last ( ) . expect ( "segments were empty" ) ;
17451745 let mut args = DefIdMap :: default ( ) ;
1746- let generic_args = provided_params . args ( ) ;
1746+ let generic_args = final_seg . args ( ) ;
17471747
17481748 let mut indices: hir:: GenericParamCount = Default :: default ( ) ;
17491749 for param in generics. params . iter ( ) {
@@ -1775,7 +1775,7 @@ fn maybe_expand_private_type_alias<'tcx>(
17751775 let type_ = generic_args. args . iter ( ) . find_map ( |arg| match arg {
17761776 hir:: GenericArg :: Type ( ty) => {
17771777 if indices. types == j {
1778- return Some ( * ty ) ;
1778+ return Some ( ty . as_unambig_ty ( ) ) ;
17791779 }
17801780 j += 1 ;
17811781 None
@@ -1839,16 +1839,19 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
18391839 TyKind :: Path ( _) => clean_qpath ( ty, cx) ,
18401840 TyKind :: TraitObject ( bounds, lifetime) => {
18411841 let bounds = bounds. iter ( ) . map ( |bound| clean_poly_trait_ref ( bound, cx) ) . collect ( ) ;
1842- let lifetime =
1843- if !lifetime. is_elided ( ) { Some ( clean_lifetime ( lifetime. pointer ( ) , cx) ) } else { None } ;
1842+ let lifetime = if !lifetime. is_elided ( ) {
1843+ Some ( clean_lifetime ( lifetime. pointer ( ) , cx) )
1844+ } else {
1845+ None
1846+ } ;
18441847 DynTrait ( bounds, lifetime)
18451848 }
18461849 TyKind :: BareFn ( barefn) => BareFunction ( Box :: new ( clean_bare_fn_ty ( barefn, cx) ) ) ,
18471850 TyKind :: UnsafeBinder ( unsafe_binder_ty) => {
18481851 UnsafeBinder ( Box :: new ( clean_unsafe_binder_ty ( unsafe_binder_ty, cx) ) )
18491852 }
18501853 // Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
1851- TyKind :: Infer
1854+ TyKind :: Infer ( ( ) )
18521855 | TyKind :: Err ( _)
18531856 | TyKind :: Typeof ( ..)
18541857 | TyKind :: InferDelegation ( ..)
@@ -2527,8 +2530,10 @@ fn clean_generic_args<'tcx>(
25272530 GenericArg :: Lifetime ( clean_lifetime ( lt, cx) )
25282531 }
25292532 hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
2530- hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
2531- hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2533+ hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty. as_unambig_ty ( ) , cx) ) ,
2534+ hir:: GenericArg :: Const ( ct) => {
2535+ GenericArg :: Const ( Box :: new ( clean_const ( ct. as_unambig_ct ( ) , cx) ) )
2536+ }
25322537 hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
25332538 } )
25342539 . collect :: < Vec < _ > > ( )
0 commit comments