about summary refs log tree commit diff
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2014-05-08 21:32:06 -0700
committerKevin Ballard <kevin@sb.org>2014-05-08 21:37:57 -0700
commit33cc0efa3d342b292418ac9884cbb77aee882a15 (patch)
tree80bccc68a92c6afee1ece609bb2d2239f400e730
parent74172341aab4dc105f3dc1f4dd61237cc4d72d96 (diff)
downloadrust-33cc0efa3d342b292418ac9884cbb77aee882a15.tar.gz
rust-33cc0efa3d342b292418ac9884cbb77aee882a15.zip
Remove <no-bounds> on trait objects
Printing <no-bounds> 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 <no-bounds> is just noise.
-rw-r--r--src/librustc/util/ppaux.rs8
-rw-r--r--src/test/compile-fail/issue-5153.rs2
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<A:UserString> UserString for Rc<A> {
 
 impl UserString for ty::BuiltinBounds {
     fn user_string(&self, tcx: &ctxt) -> ~str {
-        if self.is_empty() { "<no-bounds>".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::<Vec<~str>>().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<no-bounds>` 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);