@@ -1747,9 +1747,9 @@ fn maybe_expand_private_type_alias<'tcx>(
1747
1747
} ;
1748
1748
let hir:: ItemKind :: TyAlias ( ty, generics) = alias else { return None } ;
1749
1749
1750
- let provided_params = & path. segments . last ( ) . expect ( "segments were empty" ) ;
1750
+ let final_seg = & path. segments . last ( ) . expect ( "segments were empty" ) ;
1751
1751
let mut args = DefIdMap :: default ( ) ;
1752
- let generic_args = provided_params . args ( ) ;
1752
+ let generic_args = final_seg . args ( ) ;
1753
1753
1754
1754
let mut indices: hir:: GenericParamCount = Default :: default ( ) ;
1755
1755
for param in generics. params . iter ( ) {
@@ -1781,7 +1781,7 @@ fn maybe_expand_private_type_alias<'tcx>(
1781
1781
let type_ = generic_args. args . iter ( ) . find_map ( |arg| match arg {
1782
1782
hir:: GenericArg :: Type ( ty) => {
1783
1783
if indices. types == j {
1784
- return Some ( * ty ) ;
1784
+ return Some ( ty . as_unambig_ty ( ) ) ;
1785
1785
}
1786
1786
j += 1 ;
1787
1787
None
@@ -1845,16 +1845,19 @@ pub(crate) fn clean_ty<'tcx>(ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> T
1845
1845
TyKind :: Path ( _) => clean_qpath ( ty, cx) ,
1846
1846
TyKind :: TraitObject ( bounds, lifetime) => {
1847
1847
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
+ } ;
1850
1853
DynTrait ( bounds, lifetime)
1851
1854
}
1852
1855
TyKind :: BareFn ( barefn) => BareFunction ( Box :: new ( clean_bare_fn_ty ( barefn, cx) ) ) ,
1853
1856
TyKind :: UnsafeBinder ( unsafe_binder_ty) => {
1854
1857
UnsafeBinder ( Box :: new ( clean_unsafe_binder_ty ( unsafe_binder_ty, cx) ) )
1855
1858
}
1856
1859
// Rustdoc handles `TyKind::Err`s by turning them into `Type::Infer`s.
1857
- TyKind :: Infer
1860
+ TyKind :: Infer ( ( ) )
1858
1861
| TyKind :: Err ( _)
1859
1862
| TyKind :: Typeof ( ..)
1860
1863
| TyKind :: InferDelegation ( ..)
@@ -2533,8 +2536,10 @@ fn clean_generic_args<'tcx>(
2533
2536
GenericArg :: Lifetime ( clean_lifetime ( lt, cx) )
2534
2537
}
2535
2538
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
+ }
2538
2543
hir:: GenericArg :: Infer ( _inf) => GenericArg :: Infer ,
2539
2544
} )
2540
2545
. collect :: < Vec < _ > > ( )
0 commit comments