@@ -1322,14 +1322,17 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1322
1322
let trait_def = cx. tcx . associated_item ( p. res . def_id ( ) ) . container_id ( cx. tcx ) ;
1323
1323
let trait_ = self :: Path {
1324
1324
res : Res :: Def ( DefKind :: Trait , trait_def) ,
1325
- segments : trait_segments. iter ( ) . map ( |x| x . clean ( cx) ) . collect ( ) ,
1325
+ segments : trait_segments. iter ( ) . map ( |x| clean_path_segment ( x , cx) ) . collect ( ) ,
1326
1326
} ;
1327
1327
register_res ( cx, trait_. res ) ;
1328
1328
let self_def_id = DefId :: local ( qself. hir_id . owner . local_def_index ) ;
1329
1329
let self_type = clean_ty ( qself, cx) ;
1330
1330
let should_show_cast = compute_should_show_cast ( Some ( self_def_id) , & trait_, & self_type) ;
1331
1331
Type :: QPath {
1332
- assoc : Box :: new ( p. segments . last ( ) . expect ( "segments were empty" ) . clean ( cx) ) ,
1332
+ assoc : Box :: new ( clean_path_segment (
1333
+ p. segments . last ( ) . expect ( "segments were empty" ) ,
1334
+ cx,
1335
+ ) ) ,
1333
1336
should_show_cast,
1334
1337
self_type : Box :: new ( self_type) ,
1335
1338
trait_,
@@ -1349,7 +1352,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1349
1352
let self_type = clean_ty ( qself, cx) ;
1350
1353
let should_show_cast = compute_should_show_cast ( self_def_id, & trait_, & self_type) ;
1351
1354
Type :: QPath {
1352
- assoc : Box :: new ( segment . clean ( cx) ) ,
1355
+ assoc : Box :: new ( clean_path_segment ( segment , cx) ) ,
1353
1356
should_show_cast,
1354
1357
self_type : Box :: new ( self_type) ,
1355
1358
trait_,
@@ -1823,7 +1826,10 @@ fn clean_variant_data<'tcx>(
1823
1826
}
1824
1827
1825
1828
fn clean_path < ' tcx > ( path : & hir:: Path < ' tcx > , cx : & mut DocContext < ' tcx > ) -> Path {
1826
- Path { res : path. res , segments : path. segments . iter ( ) . map ( |x| x. clean ( cx) ) . collect ( ) }
1829
+ Path {
1830
+ res : path. res ,
1831
+ segments : path. segments . iter ( ) . map ( |x| clean_path_segment ( x, cx) ) . collect ( ) ,
1832
+ }
1827
1833
}
1828
1834
1829
1835
fn clean_generic_args < ' tcx > (
@@ -1861,10 +1867,11 @@ fn clean_generic_args<'tcx>(
1861
1867
}
1862
1868
}
1863
1869
1864
- impl < ' tcx > Clean < ' tcx , PathSegment > for hir:: PathSegment < ' tcx > {
1865
- fn clean ( & self , cx : & mut DocContext < ' tcx > ) -> PathSegment {
1866
- PathSegment { name : self . ident . name , args : clean_generic_args ( self . args ( ) , cx) }
1867
- }
1870
+ fn clean_path_segment < ' tcx > (
1871
+ path : & hir:: PathSegment < ' tcx > ,
1872
+ cx : & mut DocContext < ' tcx > ,
1873
+ ) -> PathSegment {
1874
+ PathSegment { name : path. ident . name , args : clean_generic_args ( path. args ( ) , cx) }
1868
1875
}
1869
1876
1870
1877
impl < ' tcx > Clean < ' tcx , BareFunctionDecl > for hir:: BareFnTy < ' tcx > {
0 commit comments