diff options
| author | Michael Sullivan <sully@msully.net> | 2013-07-08 16:54:28 -0700 |
|---|---|---|
| committer | Michael Sullivan <sully@msully.net> | 2013-07-11 15:51:09 -0700 |
| commit | 82ae2fa93abbdf2b7437e9a8df4b4a18df0bf310 (patch) | |
| tree | 8a83acc797b4d63874ae0a47fb991a19d31aa533 /src | |
| parent | 38dc832154c00b57a71294be4327225d134e4aec (diff) | |
| download | rust-82ae2fa93abbdf2b7437e9a8df4b4a18df0bf310.tar.gz rust-82ae2fa93abbdf2b7437e9a8df4b4a18df0bf310.zip | |
Clean up Repr impls a bit so we can add generic impls for @ and ~.
Diffstat (limited to 'src')
| -rw-r--r-- | src/librustc/middle/mem_categorization.rs | 2 | ||||
| -rw-r--r-- | src/librustc/middle/trans/common.rs | 6 | ||||
| -rw-r--r-- | src/librustc/util/ppaux.rs | 18 |
3 files changed, 8 insertions, 18 deletions
diff --git a/src/librustc/middle/mem_categorization.rs b/src/librustc/middle/mem_categorization.rs index ac7805146e4..f5024f7973c 100644 --- a/src/librustc/middle/mem_categorization.rs +++ b/src/librustc/middle/mem_categorization.rs @@ -1185,7 +1185,7 @@ impl cmt_ { } } -impl Repr for cmt { +impl Repr for cmt_ { fn repr(&self, tcx: ty::ctxt) -> ~str { fmt!("{%s id:%d m:%? ty:%s}", self.cat.repr(tcx), diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index 24648ada893..1a45ce36af2 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -154,12 +154,6 @@ impl Repr for param_substs { } } -impl Repr for @param_substs { - fn repr(&self, tcx: ty::ctxt) -> ~str { - param_substs_to_str(*self, tcx) - } -} - // Function context. Every LLVM function we create will have one of // these. pub struct fn_ctxt_ { diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 0aae41941cd..005f46057b6 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -512,9 +512,6 @@ impl<T:Repr> Repr for Option<T> { } } -/* -Annoyingly, these conflict with @ast::expr. - impl<T:Repr> Repr for @T { fn repr(&self, tcx: ctxt) -> ~str { (&**self).repr(tcx) @@ -526,7 +523,6 @@ impl<T:Repr> Repr for ~T { (&**self).repr(tcx) } } -*/ fn repr_vec<T:Repr>(tcx: ctxt, v: &[T]) -> ~str { fmt!("[%s]", v.map(|t| t.repr(tcx)).connect(",")) @@ -538,11 +534,11 @@ impl<'self, T:Repr> Repr for &'self [T] { } } -// This is necessary to handle types like Option<@~[T]>, for which +// This is necessary to handle types like Option<~[T]>, for which // autoderef cannot convert the &[T] handler -impl<T:Repr> Repr for @~[T] { +impl<T:Repr> Repr for ~[T] { fn repr(&self, tcx: ctxt) -> ~str { - repr_vec(tcx, **self) + repr_vec(tcx, *self) } } @@ -593,19 +589,19 @@ impl Repr for ty::TraitRef { } } -impl Repr for @ast::expr { +impl Repr for ast::expr { fn repr(&self, tcx: ctxt) -> ~str { fmt!("expr(%d: %s)", self.id, - pprust::expr_to_str(*self, tcx.sess.intr())) + pprust::expr_to_str(self, tcx.sess.intr())) } } -impl Repr for @ast::pat { +impl Repr for ast::pat { fn repr(&self, tcx: ctxt) -> ~str { fmt!("pat(%d: %s)", self.id, - pprust::pat_to_str(*self, tcx.sess.intr())) + pprust::pat_to_str(self, tcx.sess.intr())) } } |
