Skip to content

Commit e3c62a2

Browse files
committed
auto merge of #14057 : kballard/rust/remove_no-bounds, r=sfackler
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.
2 parents 3d6cf1d + 33cc0ef commit e3c62a2

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

src/librustc/util/ppaux.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -889,13 +889,7 @@ impl<A:UserString> UserString for Rc<A> {
889889

890890
impl UserString for ty::BuiltinBounds {
891891
fn user_string(&self, tcx: &ctxt) -> ~str {
892-
if self.is_empty() { "<no-bounds>".to_owned() } else {
893-
let mut result = Vec::new();
894-
for bb in self.iter() {
895-
result.push(bb.user_string(tcx));
896-
}
897-
result.connect("+")
898-
}
892+
self.iter().map(|bb| bb.user_string(tcx)).collect::<Vec<~str>>().connect("+")
899893
}
900894
}
901895

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

+1-1
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)