Skip to content

Commit 63bde14

Browse files
committed
---
yaml --- r: 101726 b: refs/heads/master c: 42cd820 h: refs/heads/master v: v3
1 parent 2e03bbd commit 63bde14

File tree

2 files changed

+46
-2
lines changed

2 files changed

+46
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 95c53c049c9ced13c325c9aade22affbf5d97fa3
2+
refs/heads/master: 42cd820c62c531f20d763281c7cc2bdaa1e0a89a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6e7f170fedd3c526a643c0b2d13863acd982be02
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff

trunk/src/librustc/util/ppaux.rs

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -565,11 +565,26 @@ impl<T:Repr> Repr for Option<T> {
565565
fn repr(&self, tcx: ctxt) -> ~str {
566566
match self {
567567
&None => ~"None",
568-
&Some(ref t) => format!("Some({})", t.repr(tcx))
568+
&Some(ref t) => t.repr(tcx),
569569
}
570570
}
571571
}
572572

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+
573588
impl<T:Repr> Repr for @T {
574589
fn repr(&self, tcx: ctxt) -> ~str {
575590
(&**self).repr(tcx)
@@ -1021,3 +1036,32 @@ impl UserString for AbiSet {
10211036
self.to_str()
10221037
}
10231038
}
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

Comments
 (0)