@@ -565,11 +565,26 @@ impl<T:Repr> Repr for Option<T> {
565
565
fn repr ( & self , tcx : ctxt ) -> ~str {
566
566
match self {
567
567
& None => ~"None ",
568
- & Some ( ref t) => format ! ( "Some({})" , t. repr( tcx) )
568
+ & Some ( ref t) => t. repr ( tcx) ,
569
569
}
570
570
}
571
571
}
572
572
573
+ impl < T : Repr , U : Repr > Repr for Result < T , U > {
574
+ fn repr ( & self , tcx : ctxt ) -> ~str {
575
+ match self {
576
+ & Ok ( ref t) => t. repr ( tcx) ,
577
+ & Err ( ref u) => format ! ( "Err({})" , u. repr( tcx) )
578
+ }
579
+ }
580
+ }
581
+
582
+ impl Repr for ( ) {
583
+ fn repr ( & self , _tcx : ctxt ) -> ~str {
584
+ ~"( ) "
585
+ }
586
+ }
587
+
573
588
impl < T : Repr > Repr for @T {
574
589
fn repr ( & self , tcx : ctxt ) -> ~str {
575
590
( & * * self ) . repr ( tcx)
@@ -1021,3 +1036,32 @@ impl UserString for AbiSet {
1021
1036
self.to_str()
1022
1037
}
1023
1038
}
1039
+
1040
+ impl Repr for ty::UpvarId {
1041
+ fn repr(&self, tcx: ctxt) -> ~str {
1042
+ format!(" UpvarId ( { } ; `{ } `; { } ) ",
1043
+ self . var_id ,
1044
+ ty:: local_var_name_str( tcx, self . var_id ) ,
1045
+ self . closure_expr_id )
1046
+ }
1047
+ }
1048
+
1049
+ impl Repr for ast:: Mutability {
1050
+ fn repr ( & self , _tcx : ctxt ) -> ~str {
1051
+ format ! ( "{:?}" , * self )
1052
+ }
1053
+ }
1054
+
1055
+ impl Repr for ty:: BorrowKind {
1056
+ fn repr ( & self , _tcx : ctxt ) -> ~str {
1057
+ format ! ( "{:?}" , * self )
1058
+ }
1059
+ }
1060
+
1061
+ impl Repr for ty:: UpvarBorrow {
1062
+ fn repr ( & self , tcx : ctxt ) -> ~str {
1063
+ format ! ( "UpvarBorrow({}, {})" ,
1064
+ self . kind. repr( tcx) ,
1065
+ self . region. repr( tcx) )
1066
+ }
1067
+ }
0 commit comments