Skip to content

Commit ff0a42c

Browse files
committed
---
yaml --- r: 100702 b: refs/heads/snap-stage3 c: 42cd820 h: refs/heads/master v: v3
1 parent 7b2916f commit ff0a42c

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,7 +1,7 @@
11
---
22
refs/heads/master: e3b1f3c443c048913e2d573fcc5a9c2be3484a78
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 95c53c049c9ced13c325c9aade22affbf5d97fa3
4+
refs/heads/snap-stage3: 42cd820c62c531f20d763281c7cc2bdaa1e0a89a
55
refs/heads/try: a97642026c18a624ff6ea01075dd9550f8ed07ff
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/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)