@@ -1741,9 +1741,9 @@ fn maybe_expand_private_type_alias<'tcx>(
1741
1741
} ;
1742
1742
let hir:: ItemKind :: TyAlias ( ty, generics) = alias else { return None } ;
1743
1743
1744
- let provided_params = & path. segments . last ( ) . expect ( "segments were empty" ) ;
1744
+ let final_seg = & path. segments . last ( ) . expect ( "segments were empty" ) ;
1745
1745
let mut args = DefIdMap :: default ( ) ;
1746
- let generic_args = provided_params . args ( ) ;
1746
+ let generic_args = final_seg . args ( ) ;
1747
1747
1748
1748
let mut indices: hir:: GenericParamCount = Default :: default ( ) ;
1749
1749
for param in generics. params . iter ( ) {
@@ -1775,7 +1775,7 @@ fn maybe_expand_private_type_alias<'tcx>(
1775
1775
let type_ = generic_args. args . iter ( ) . find_map ( |arg| match arg {
1776
1776
hir:: GenericArg :: Type ( ty) => {
1777
1777
if indices. types == j {
1778
- return Some ( * ty ) ;
1778
+ return Some ( ty . as_unambig_ty ( ) ) ;
1779
1779
}
1780
1780
j += 1 ;
1781
1781
None
@@ -1839,16 +1839,19 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
1839
1839
TyKind :: Path ( _) => clean_qpath ( ty, cx) ,
1840
1840
TyKind :: TraitObject ( bounds, lifetime) => {
1841
1841
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
+ } ;
1844
1847
DynTrait ( bounds, lifetime)
1845
1848
}
1846
1849
TyKind :: BareFn ( barefn) => BareFunction ( Box :: new ( clean_bare_fn_ty ( barefn, cx) ) ) ,
1847
1850
TyKind :: UnsafeBinder ( unsafe_binder_ty) => {
1848
1851
UnsafeBinder ( Box :: new ( clean_unsafe_binder_ty ( unsafe_binder_ty, cx) ) )
1849
1852
}
1850
1853
// Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
1851
- TyKind :: Infer
1854
+ TyKind :: Infer ( ( ) )
1852
1855
| TyKind :: Err ( _)
1853
1856
| TyKind :: Typeof ( ..)
1854
1857
| TyKind :: InferDelegation ( ..)
@@ -2527,8 +2530,10 @@ fn clean_generic_args<'tcx>(
2527
2530
GenericArg :: Lifetime ( clean_lifetime ( lt, cx) )
2528
2531
}
2529
2532
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
+ }
2532
2537
hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
2533
2538
} )
2534
2539
. collect :: < Vec < _ > > ( )
0 commit comments