@@ -503,16 +503,16 @@ fn clean_projection<'tcx>(
503503 } else {
504504 self_type. def_id ( & cx. cache )
505505 } ;
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) ;
507507 Type :: QPath ( Box :: new ( QPathData {
508508 assoc : projection_to_path_segment ( ty, cx) ,
509- should_show_cast ,
509+ should_fully_qualify ,
510510 self_type,
511511 trait_ : Some ( trait_) ,
512512 } ) )
513513}
514514
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 {
516516 !trait_. segments . is_empty ( )
517517 && self_def_id
518518 . zip ( Some ( trait_. def_id ( ) ) )
@@ -1695,10 +1695,11 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
16951695 register_res ( cx, trait_. res ) ;
16961696 let self_def_id = DefId :: local ( qself. hir_id . owner . def_id . local_def_index ) ;
16971697 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) ;
16991700 Type :: QPath ( Box :: new ( QPathData {
17001701 assoc : clean_path_segment ( p. segments . last ( ) . expect ( "segments were empty" ) , cx) ,
1701- should_show_cast ,
1702+ should_fully_qualify ,
17021703 self_type,
17031704 trait_ : Some ( trait_) ,
17041705 } ) )
@@ -1707,16 +1708,16 @@ fn clean_qpath<'tcx>(hir_ty: &hir::Ty<'tcx>, cx: &mut DocContext<'tcx>) -> Type
17071708 let ty = lower_ty ( cx. tcx , hir_ty) ;
17081709 let self_type = clean_ty ( qself, cx) ;
17091710
1710- let ( trait_, should_show_cast ) = match ty. kind ( ) {
1711+ let ( trait_, should_fully_qualify ) = match ty. kind ( ) {
17111712 ty:: Alias ( ty:: Projection , proj) => {
17121713 let res = Res :: Def ( DefKind :: Trait , proj. trait_ref ( cx. tcx ) . def_id ) ;
17131714 let trait_ = clean_path ( & hir:: Path { span, res, segments : & [ ] } , cx) ;
17141715 register_res ( cx, trait_. res ) ;
17151716 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) ;
17181719
1719- ( Some ( trait_) , should_show_cast )
1720+ ( Some ( trait_) , should_fully_qualify )
17201721 }
17211722 ty:: Alias ( ty:: Inherent , _) => ( None , false ) ,
17221723 // 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
17261727
17271728 Type :: QPath ( Box :: new ( QPathData {
17281729 assoc : clean_path_segment ( segment, cx) ,
1729- should_show_cast ,
1730+ should_fully_qualify ,
17301731 self_type,
17311732 trait_,
17321733 } ) )
@@ -2207,7 +2208,7 @@ pub(crate) fn clean_middle_ty<'tcx>(
22072208 constraints : Default :: default ( ) ,
22082209 } ,
22092210 } ,
2210- should_show_cast : false ,
2211+ should_fully_qualify : false ,
22112212 self_type,
22122213 trait_ : None ,
22132214 } ) )
0 commit comments