]> git.lizzy.rs Git - rust.git/commitdiff
Remove <no-bounds> on trait objects
authorKevin Ballard <kevin@sb.org>
Fri, 9 May 2014 04:32:06 +0000 (21:32 -0700)
committerKevin Ballard <kevin@sb.org>
Fri, 9 May 2014 04:37:57 +0000 (21:37 -0700)
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.

src/librustc/util/ppaux.rs
src/test/compile-fail/issue-5153.rs

index 1808c0209b754c1e39e62b503753380643b45b7c..90d031dcf9e37593584917cb75a521b34087f192 100644 (file)
@@ -883,13 +883,7 @@ fn user_string(&self, tcx: &ctxt) -> ~str {
 
 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("+")
     }
 }
 
index 5228e03b8bd82aee71d0212a902e9077a591fcc2..f8c1a91464271c58f81621e9e74822d317e61efc 100644 (file)
@@ -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);