From 33cc0efa3d342b292418ac9884cbb77aee882a15 Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Thu, 8 May 2014 21:32:06 -0700 Subject: [PATCH] Remove on trait objects Printing on trait objects comes from a time when trait objects had a non-empty default bounds set. As they no longer have any default bounds, printing is just noise. --- src/librustc/util/ppaux.rs | 8 +------- src/test/compile-fail/issue-5153.rs | 2 +- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 1808c0209b7..90d031dcf9e 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -883,13 +883,7 @@ impl UserString for Rc { impl UserString for ty::BuiltinBounds { fn user_string(&self, tcx: &ctxt) -> ~str { - if self.is_empty() { "".to_owned() } else { - let mut result = Vec::new(); - for bb in self.iter() { - result.push(bb.user_string(tcx)); - } - result.connect("+") - } + self.iter().map(|bb| bb.user_string(tcx)).collect::>().connect("+") } } diff --git a/src/test/compile-fail/issue-5153.rs b/src/test/compile-fail/issue-5153.rs index 5228e03b8bd..f8c1a914642 100644 --- a/src/test/compile-fail/issue-5153.rs +++ b/src/test/compile-fail/issue-5153.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -// error-pattern: type `&Foo` does not implement any method in scope named `foo` +// error-pattern: type `&Foo` does not implement any method in scope named `foo` trait Foo { fn foo(~self);