Skip to content

Commit af7daa0

Browse files
committed
rustc: remove some unused UserString and Repr impls.
1 parent b510ea1 commit af7daa0

File tree

3 files changed

+3
-28
lines changed

3 files changed

+3
-28
lines changed

src/librustc/util/ppaux.rs

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ pub trait Repr {
4545
}
4646

4747
/// Produces a string suitable for showing to the user.
48-
pub trait UserString: Repr {
48+
pub trait UserString {
4949
fn user_string(&self) -> String;
5050
}
5151

@@ -296,14 +296,6 @@ impl<'a, T: ?Sized +UserString> UserString for &'a T {
296296
}
297297
}
298298

299-
impl<T:UserString> UserString for Vec<T> {
300-
fn user_string(&self) -> String {
301-
let strs: Vec<String> =
302-
self.iter().map(|t| t.user_string()).collect();
303-
strs.connect(", ")
304-
}
305-
}
306-
307299
impl Repr for def::Def {
308300
fn repr(&self) -> String {
309301
format!("{:?}", *self)
@@ -475,17 +467,6 @@ impl<'tcx> Repr for ty::TraitDef<'tcx> {
475467
}
476468
}
477469

478-
impl Repr for ast::TraitItem {
479-
fn repr(&self) -> String {
480-
let kind = match self.node {
481-
ast::ConstTraitItem(..) => "ConstTraitItem",
482-
ast::MethodTraitItem(..) => "MethodTraitItem",
483-
ast::TypeTraitItem(..) => "TypeTraitItem",
484-
};
485-
format!("{}({}, id={})", kind, self.ident, self.id)
486-
}
487-
}
488-
489470
impl Repr for ast::Expr {
490471
fn repr(&self) -> String {
491472
format!("expr({}: {})", self.id, pprust::expr_to_string(self))
@@ -794,12 +775,6 @@ impl UserString for ast::Name {
794775
}
795776
}
796777

797-
impl Repr for ast::Ident {
798-
fn repr(&self) -> String {
799-
token::get_ident(*self).to_string()
800-
}
801-
}
802-
803778
impl Repr for ast::ExplicitSelf_ {
804779
fn repr(&self) -> String {
805780
format!("{:?}", *self)

src/librustc_trans/trans/meth.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ pub fn trans_impl(ccx: &CrateContext,
6262
let _icx = push_ctxt("meth::trans_impl");
6363
let tcx = ccx.tcx();
6464

65-
debug!("trans_impl(name={}, id={})", name.repr(), id);
65+
debug!("trans_impl(name={}, id={})", name, id);
6666

6767
let mut v = TransItemVisitor { ccx: ccx };
6868

src/librustc_typeck/collect.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ fn convert_method<'a, 'tcx>(ccx: &CrateCtxt<'a, 'tcx>,
635635
let fty = ty::mk_bare_fn(ccx.tcx, Some(def_id),
636636
ccx.tcx.mk_bare_fn(ty_method.fty.clone()));
637637
debug!("method {} (id {}) has type {}",
638-
ident.repr(), id, fty.repr());
638+
ident, id, fty.repr());
639639
ccx.tcx.tcache.borrow_mut().insert(def_id,TypeScheme {
640640
generics: ty_method.generics.clone(),
641641
ty: fty

0 commit comments

Comments
 (0)