Skip to content

Commit 33cc0ef

Browse files
committed
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.
1 parent 7417234 commit 33cc0ef

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/librustc/util/ppaux.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -883,13 +883,7 @@ impl<A:UserString> UserString for Rc<A> {
883883

884884
impl UserString for ty::BuiltinBounds {
885885
fn user_string(&self, tcx: &ctxt) -> ~str {
886-
if self.is_empty() { "<no-bounds>".to_owned() } else {
887-
let mut result = Vec::new();
888-
for bb in self.iter() {
889-
result.push(bb.user_string(tcx));
890-
}
891-
result.connect("+")
892-
}
886+
self.iter().map(|bb| bb.user_string(tcx)).collect::<Vec<~str>>().connect("+")
893887
}
894888
}
895889

src/test/compile-fail/issue-5153.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: type `&Foo<no-bounds>` does not implement any method in scope named `foo`
11+
// error-pattern: type `&Foo` does not implement any method in scope named `foo`
1212

1313
trait Foo {
1414
fn foo(~self);

0 commit comments

Comments
 (0)