@@ -810,8 +810,12 @@ impl<'tcx> Repr<'tcx> for ty::TraitRef<'tcx> {
810
810
// to enumerate the `for<...>` etc because the debruijn index
811
811
// tells you everything you need to know.
812
812
let base = ty:: item_path_str ( tcx, self . def_id ) ;
813
- parameterized ( tcx, & base, self . substs , self . def_id , & [ ] ,
814
- || ty:: lookup_trait_def ( tcx, self . def_id ) . generics . clone ( ) )
813
+ let result = parameterized ( tcx, & base, self . substs , self . def_id , & [ ] ,
814
+ || ty:: lookup_trait_def ( tcx, self . def_id ) . generics . clone ( ) ) ;
815
+ match self . substs . self_ty ( ) {
816
+ None => result,
817
+ Some ( sty) => format ! ( "<{} as {}>" , sty. repr( tcx) , result)
818
+ }
815
819
}
816
820
}
817
821
@@ -1504,8 +1508,7 @@ impl<'tcx> UserString<'tcx> for ty::ProjectionPredicate<'tcx> {
1504
1508
1505
1509
impl < ' tcx > Repr < ' tcx > for ty:: ProjectionTy < ' tcx > {
1506
1510
fn repr ( & self , tcx : & ctxt < ' tcx > ) -> String {
1507
- format ! ( "<{} as {}>::{}" ,
1508
- self . trait_ref. substs. self_ty( ) . repr( tcx) ,
1511
+ format ! ( "{}::{}" ,
1509
1512
self . trait_ref. repr( tcx) ,
1510
1513
self . item_name. repr( tcx) )
1511
1514
}
0 commit comments