@@ -1747,9 +1747,9 @@ fn maybe_expand_private_type_alias<'tcx>(
17471747 } ;
17481748 let hir:: ItemKind :: TyAlias ( ty, generics) = alias else { return None } ;
17491749
1750- let provided_params = & path. segments . last ( ) . expect ( "segments were empty" ) ;
1750+ let final_seg = & path. segments . last ( ) . expect ( "segments were empty" ) ;
17511751 let mut args = DefIdMap :: default ( ) ;
1752- let generic_args = provided_params . args ( ) ;
1752+ let generic_args = final_seg . args ( ) ;
17531753
17541754 let mut indices: hir:: GenericParamCount = Default :: default ( ) ;
17551755 for param in generics. params . iter ( ) {
@@ -1781,7 +1781,7 @@ fn maybe_expand_private_type_alias<'tcx>(
17811781 let type_ = generic_args. args . iter ( ) . find_map ( |arg| match arg {
17821782 hir:: GenericArg :: Type ( ty) => {
17831783 if indices. types == j {
1784- return Some ( * ty ) ;
1784+ return Some ( ty . as_unambig_ty ( ) ) ;
17851785 }
17861786 j += 1 ;
17871787 None
@@ -1845,16 +1845,19 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
18451845 TyKind :: Path ( _) => clean_qpath ( ty, cx) ,
18461846 TyKind :: TraitObject ( bounds, lifetime) => {
18471847 let bounds = bounds. iter ( ) . map ( |bound| clean_poly_trait_ref ( bound, cx) ) . collect ( ) ;
1848- let lifetime =
1849- if !lifetime. is_elided ( ) { Some ( clean_lifetime ( lifetime. pointer ( ) , cx) ) } else { None } ;
1848+ let lifetime = if !lifetime. is_elided ( ) {
1849+ Some ( clean_lifetime ( lifetime. pointer ( ) , cx) )
1850+ } else {
1851+ None
1852+ } ;
18501853 DynTrait ( bounds, lifetime)
18511854 }
18521855 TyKind :: BareFn ( barefn) => BareFunction ( Box :: new ( clean_bare_fn_ty ( barefn, cx) ) ) ,
18531856 TyKind :: UnsafeBinder ( unsafe_binder_ty) => {
18541857 UnsafeBinder ( Box :: new ( clean_unsafe_binder_ty ( unsafe_binder_ty, cx) ) )
18551858 }
18561859 // Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
1857- TyKind :: Infer
1860+ TyKind :: Infer ( ( ) )
18581861 | TyKind :: Err ( _)
18591862 | TyKind :: Typeof ( ..)
18601863 | TyKind :: InferDelegation ( ..)
@@ -2533,8 +2536,10 @@ fn clean_generic_args<'tcx>(
25332536 GenericArg :: Lifetime ( clean_lifetime ( lt, cx) )
25342537 }
25352538 hir:: GenericArg :: Lifetime ( _) => GenericArg :: Lifetime ( Lifetime :: elided ( ) ) ,
2536- hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty, cx) ) ,
2537- hir:: GenericArg :: Const ( ct) => GenericArg :: Const ( Box :: new ( clean_const ( ct, cx) ) ) ,
2539+ hir:: GenericArg :: Type ( ty) => GenericArg :: Type ( clean_ty ( ty. as_unambig_ty ( ) , cx) ) ,
2540+ hir:: GenericArg :: Const ( ct) => {
2541+ GenericArg :: Const ( Box :: new ( clean_const ( ct. as_unambig_ct ( ) , cx) ) )
2542+ }
25382543 hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
25392544 } )
25402545 . collect :: < Vec < _ > > ( )
0 commit comments