@@ -497,7 +497,13 @@ pub fn parameterized(cx: &ctxt,
497
497
498
498
if cx. sess . verbose ( ) {
499
499
for t in substs. types . get_slice ( subst:: SelfSpace ) . iter ( ) {
500
- strs. push ( format ! ( "for {}" , t. repr( cx) ) ) ;
500
+ strs. push ( format ! ( "self {}" , t. repr( cx) ) ) ;
501
+ }
502
+
503
+ // generally there shouldn't be any substs in the fn param
504
+ // space, but in verbose mode, print them out.
505
+ for t in substs. types . get_slice ( subst:: FnSpace ) . iter ( ) {
506
+ strs. push ( format ! ( "fn {}" , t. repr( cx) ) ) ;
501
507
}
502
508
}
503
509
@@ -540,6 +546,12 @@ impl Repr for () {
540
546
}
541
547
}
542
548
549
+ impl < ' a , T : Repr > Repr for & ' a T {
550
+ fn repr ( & self , tcx : & ctxt ) -> String {
551
+ ( & * * self ) . repr ( tcx)
552
+ }
553
+ }
554
+
543
555
impl < T : Repr > Repr for Rc < T > {
544
556
fn repr ( & self , tcx : & ctxt ) -> String {
545
557
( & * * self ) . repr ( tcx)
@@ -691,7 +703,11 @@ impl Repr for ty::ParamBounds {
691
703
692
704
impl Repr for ty:: TraitRef {
693
705
fn repr ( & self , tcx : & ctxt ) -> String {
694
- trait_ref_to_string ( tcx, self )
706
+ let base = ty:: item_path_str ( tcx, self . def_id ) ;
707
+ let trait_def = ty:: lookup_trait_def ( tcx, self . def_id ) ;
708
+ format ! ( "<{} as {}>" ,
709
+ self . substs. self_ty( ) . repr( tcx) ,
710
+ parameterized( tcx, base. as_slice( ) , & self . substs, & trait_def. generics) )
695
711
}
696
712
}
697
713
@@ -965,18 +981,16 @@ impl Repr for typeck::MethodOrigin {
965
981
966
982
impl Repr for typeck:: MethodParam {
967
983
fn repr ( & self , tcx : & ctxt ) -> String {
968
- format ! ( "MethodParam({},{:?},{:?},{:?})" ,
969
- self . trait_id. repr( tcx) ,
970
- self . method_num,
971
- self . param_num,
972
- self . bound_num)
984
+ format ! ( "MethodParam({},{})" ,
985
+ self . trait_ref. repr( tcx) ,
986
+ self . method_num)
973
987
}
974
988
}
975
989
976
990
impl Repr for typeck:: MethodObject {
977
991
fn repr ( & self , tcx : & ctxt ) -> String {
978
992
format ! ( "MethodObject({},{:?},{:?})" ,
979
- self . trait_id . repr( tcx) ,
993
+ self . trait_ref . repr( tcx) ,
980
994
self . method_num,
981
995
self . real_index)
982
996
}
@@ -1234,3 +1248,4 @@ impl<A:Repr,B:Repr> Repr for (A,B) {
1234
1248
format ! ( "({},{})" , a. repr( tcx) , b. repr( tcx) )
1235
1249
}
1236
1250
}
1251
+
0 commit comments