@@ -496,7 +496,13 @@ pub fn parameterized(cx: &ctxt,
496
496
497
497
if cx. sess . verbose ( ) {
498
498
for t in substs. types . get_slice ( subst:: SelfSpace ) . iter ( ) {
499
- strs. push ( format ! ( "for {}" , t. repr( cx) ) ) ;
499
+ strs. push ( format ! ( "self {}" , t. repr( cx) ) ) ;
500
+ }
501
+
502
+ // generally there shouldn't be any substs in the fn param
503
+ // space, but in verbose mode, print them out.
504
+ for t in substs. types . get_slice ( subst:: FnSpace ) . iter ( ) {
505
+ strs. push ( format ! ( "fn {}" , t. repr( cx) ) ) ;
500
506
}
501
507
}
502
508
@@ -539,15 +545,15 @@ impl Repr for () {
539
545
}
540
546
}
541
547
542
- impl < T : Repr > Repr for Rc < T > {
548
+ impl < ' a , T : Repr > Repr for & ' a T {
543
549
fn repr ( & self , tcx : & ctxt ) -> String {
544
550
( & * * self ) . repr ( tcx)
545
551
}
546
552
}
547
553
548
- impl < ' a , T : Repr > Repr for & ' a T {
554
+ impl < T : Repr > Repr for Rc < T > {
549
555
fn repr ( & self , tcx : & ctxt ) -> String {
550
- ( * self ) . repr ( tcx)
556
+ ( & * * self ) . repr ( tcx)
551
557
}
552
558
}
553
559
@@ -690,7 +696,11 @@ impl Repr for ty::ParamBounds {
690
696
691
697
impl Repr for ty:: TraitRef {
692
698
fn repr ( & self , tcx : & ctxt ) -> String {
693
- trait_ref_to_string ( tcx, self )
699
+ let base = ty:: item_path_str ( tcx, self . def_id ) ;
700
+ let trait_def = ty:: lookup_trait_def ( tcx, self . def_id ) ;
701
+ format ! ( "<{} as {}>" ,
702
+ self . substs. self_ty( ) . repr( tcx) ,
703
+ parameterized( tcx, base. as_slice( ) , & self . substs, & trait_def. generics) )
694
704
}
695
705
}
696
706
@@ -962,18 +972,16 @@ impl Repr for typeck::MethodOrigin {
962
972
963
973
impl Repr for typeck:: MethodParam {
964
974
fn repr ( & self , tcx : & ctxt ) -> String {
965
- format ! ( "MethodParam({},{:?},{:?},{:?})" ,
966
- self . trait_id. repr( tcx) ,
967
- self . method_num,
968
- self . param_num,
969
- self . bound_num)
975
+ format ! ( "MethodParam({},{})" ,
976
+ self . trait_ref. repr( tcx) ,
977
+ self . method_num)
970
978
}
971
979
}
972
980
973
981
impl Repr for typeck:: MethodObject {
974
982
fn repr ( & self , tcx : & ctxt ) -> String {
975
983
format ! ( "MethodObject({},{:?},{:?})" ,
976
- self . trait_id . repr( tcx) ,
984
+ self . trait_ref . repr( tcx) ,
977
985
self . method_num,
978
986
self . real_index)
979
987
}
@@ -1231,3 +1239,4 @@ impl<A:Repr,B:Repr> Repr for (A,B) {
1231
1239
format ! ( "({},{})" , a. repr( tcx) , b. repr( tcx) )
1232
1240
}
1233
1241
}
1242
+
0 commit comments