@@ -503,16 +503,16 @@ fn clean_projection<'tcx>(
503
503
} else {
504
504
self_type. def_id ( & cx. cache )
505
505
} ;
506
- let should_show_cast = compute_should_show_cast ( self_def_id, & trait_, & self_type) ;
506
+ let should_fully_qualify = should_fully_qualify_path ( self_def_id, & trait_, & self_type) ;
507
507
Type :: QPath ( Box :: new ( QPathData {
508
508
assoc : projection_to_path_segment ( ty, cx) ,
509
- should_show_cast ,
509
+ should_fully_qualify ,
510
510
self_type,
511
511
trait_ : Some ( trait_) ,
512
512
} ) )
513
513
}
514
514
515
- fn compute_should_show_cast ( self_def_id : Option < DefId > , trait_ : & Path , self_type : & Type ) -> bool {
515
+ fn should_fully_qualify_path ( self_def_id : Option < DefId > , trait_ : & Path , self_type : & Type ) -> bool {
516
516
!trait_. segments . is_empty ( )
517
517
&& self_def_id
518
518
. zip ( Some ( trait_. def_id ( ) ) )
@@ -1695,10 +1695,11 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1695
1695
register_res ( cx, trait_. res ) ;
1696
1696
let self_def_id = DefId :: local ( qself. hir_id . owner . def_id . local_def_index ) ;
1697
1697
let self_type = clean_ty ( qself, cx) ;
1698
- let should_show_cast = compute_should_show_cast ( Some ( self_def_id) , & trait_, & self_type) ;
1698
+ let should_fully_qualify =
1699
+ should_fully_qualify_path ( Some ( self_def_id) , & trait_, & self_type) ;
1699
1700
Type :: QPath ( Box :: new ( QPathData {
1700
1701
assoc : clean_path_segment ( p. segments . last ( ) . expect ( "segments were empty" ) , cx) ,
1701
- should_show_cast ,
1702
+ should_fully_qualify ,
1702
1703
self_type,
1703
1704
trait_ : Some ( trait_) ,
1704
1705
} ) )
@@ -1707,16 +1708,16 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1707
1708
let ty = lower_ty ( cx. tcx , hir_ty) ;
1708
1709
let self_type = clean_ty ( qself, cx) ;
1709
1710
1710
- let ( trait_, should_show_cast ) = match ty. kind ( ) {
1711
+ let ( trait_, should_fully_qualify ) = match ty. kind ( ) {
1711
1712
ty:: Alias ( ty:: Projection , proj) => {
1712
1713
let res = Res :: Def ( DefKind :: Trait , proj. trait_ref ( cx. tcx ) . def_id ) ;
1713
1714
let trait_ = clean_path ( & hir:: Path { span, res, segments : & [ ] } , cx) ;
1714
1715
register_res ( cx, trait_. res ) ;
1715
1716
let self_def_id = res. opt_def_id ( ) ;
1716
- let should_show_cast =
1717
- compute_should_show_cast ( self_def_id, & trait_, & self_type) ;
1717
+ let should_fully_qualify =
1718
+ should_fully_qualify_path ( self_def_id, & trait_, & self_type) ;
1718
1719
1719
- ( Some ( trait_) , should_show_cast )
1720
+ ( Some ( trait_) , should_fully_qualify )
1720
1721
}
1721
1722
ty:: Alias ( ty:: Inherent , _) => ( None , false ) ,
1722
1723
// Rustdoc handles `ty::Error`s by turning them into `Type::Infer`s.
@@ -1726,7 +1727,7 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
1726
1727
1727
1728
Type :: QPath ( Box :: new ( QPathData {
1728
1729
assoc : clean_path_segment ( segment, cx) ,
1729
- should_show_cast ,
1730
+ should_fully_qualify ,
1730
1731
self_type,
1731
1732
trait_,
1732
1733
} ) )
@@ -2207,7 +2208,7 @@ pub(crate) fn clean_middle_ty<'tcx>(
2207
2208
constraints : Default :: default ( ) ,
2208
2209
} ,
2209
2210
} ,
2210
- should_show_cast : false ,
2211
+ should_fully_qualify : false ,
2211
2212
self_type,
2212
2213
trait_ : None ,
2213
2214
} ) )
0 commit comments