about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard Burtescu <edy.burt@gmail.com>2015-06-17 09:53:07 +0300
committerEduard Burtescu <edy.burt@gmail.com>2015-06-19 01:32:45 +0300
commitaf7daa0daff91f8a58708f2d98f94d49acc28c6a (patch)
tree015e17a0a97ee1f638580421d1b453d0f104e4d0
parentb510ea1487286123c00f425b368a8328637ac947 (diff)
downloadrust-af7daa0daff91f8a58708f2d98f94d49acc28c6a.tar.gz
rust-af7daa0daff91f8a58708f2d98f94d49acc28c6a.zip
rustc: remove some unused UserString and Repr impls.
-rw-r--r--src/librustc/util/ppaux.rs27
-rw-r--r--src/librustc_trans/trans/meth.rs2
-rw-r--r--src/librustc_typeck/collect.rs2
3 files changed, 3 insertions, 28 deletions
diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs
index 079741b0f28..7b82b49dadb 100644
--- a/src/librustc/util/ppaux.rs
+++ b/src/librustc/util/ppaux.rs
@@ -45,7 +45,7 @@ pub trait Repr {
 }
 
 /// Produces a string suitable for showing to the user.
-pub trait UserString: Repr {
+pub trait UserString {
     fn user_string(&self) -> String;
 }
 
@@ -296,14 +296,6 @@ impl<'a, T: ?Sized +UserString> UserString for &'a T {
     }
 }
 
-impl<T:UserString> UserString for Vec<T> {
-    fn user_string(&self) -> String {
-        let strs: Vec<String> =
-            self.iter().map(|t| t.user_string()).collect();
-        strs.connect(", ")
-    }
-}
-
 impl Repr for def::Def {
     fn repr(&self) -> String {
         format!("{:?}", *self)
@@ -475,17 +467,6 @@ impl<'tcx> Repr for ty::TraitDef<'tcx> {
     }
 }
 
-impl Repr for ast::TraitItem {
-    fn repr(&self) -> String {
-        let kind = match self.node {
-            ast::ConstTraitItem(..) => "ConstTraitItem",
-            ast::MethodTraitItem(..) => "MethodTraitItem",
-            ast::TypeTraitItem(..) => "TypeTraitItem",
-        };
-        format!("{}({}, id={})", kind, self.ident, self.id)
-    }
-}
-
 impl Repr for ast::Expr {
     fn repr(&self) -> String {
         format!("expr({}: {})", self.id, pprust::expr_to_string(self))
@@ -794,12 +775,6 @@ impl UserString for ast::Name {
     }
 }
 
-impl Repr for ast::Ident {
-    fn repr(&self) -> String {
-        token::get_ident(*self).to_string()
-    }
-}
-
 impl Repr for ast::ExplicitSelf_ {
     fn repr(&self) -> String {
         format!("{:?}", *self)
diff --git a/src/librustc_trans/trans/meth.rs b/src/librustc_trans/trans/meth.rs
index 7229995048a..ec95bfe483c 100644
--- a/src/librustc_trans/trans/meth.rs
+++ b/src/librustc_trans/trans/meth.rs
@@ -62,7 +62,7 @@ pub fn trans_impl(ccx: &CrateContext,
     let _icx = push_ctxt("meth::trans_impl");
     let tcx = ccx.tcx();
 
-    debug!("trans_impl(name={}, id={})", name.repr(), id);
+    debug!("trans_impl(name={}, id={})", name, id);
 
     let mut v = TransItemVisitor { ccx: ccx };
 
diff --git a/src/librustc_typeck/collect.rs b/src/librustc_typeck/collect.rs
index ff7c8e69a6b..4bb9aa49557 100644
--- a/src/librustc_typeck/collect.rs
+++ b/src/librustc_typeck/collect.rs
@@ -635,7 +635,7 @@ fn convert_method<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
     let fty = ty::mk_bare_fn(ccx.tcx, Some(def_id),
                              ccx.tcx.mk_bare_fn(ty_method.fty.clone()));
     debug!("method {} (id {}) has type {}",
-            ident.repr(), id, fty.repr());
+            ident, id, fty.repr());
     ccx.tcx.tcache.borrow_mut().insert(def_id,TypeScheme {
         generics: ty_method.generics.clone(),
         ty: fty