summary refs log tree commit diff
path: root/src/libsyntax/print
diff options
context:
space:
mode:
authorTim Chevalier <chevalier@alum.wellesley.edu>2012-10-16 22:14:59 -0700
committerTim Chevalier <chevalier@alum.wellesley.edu>2012-10-22 09:01:12 -0700
commit46d4bbbae4e52b79c23136b926c1e3b1f187ce4b (patch)
tree781fb02e8c6acd62d3cbad5c71bd1404e60d2a31 /src/libsyntax/print
parent42c05fe642efa726dc6cde624b40b638741724ee (diff)
downloadrust-46d4bbbae4e52b79c23136b926c1e3b1f187ce4b.tar.gz
rust-46d4bbbae4e52b79c23136b926c1e3b1f187ce4b.zip
Simplify the AST representation of ty param bounds
Change ast::ty_param_bound so that all ty param bounds are represented
as traits, with no special cases for Copy/Send/Owned/Const.
typeck::collect generates the special cases.

A consequence of this is that code using the #[no_core] attribute
can't use the Copy kind/trait. Probably not a big deal?

As a side effect, any user-defined traits that happen to be called
Copy, etc. in the same module override the built-in Copy trait.

r=nmatsakis

Closes #2284
Diffstat (limited to 'src/libsyntax/print')
-rw-r--r--src/libsyntax/print/pprust.rs10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/libsyntax/print/pprust.rs b/src/libsyntax/print/pprust.rs
index 807a78b3122..909f59552d4 100644
--- a/src/libsyntax/print/pprust.rs
+++ b/src/libsyntax/print/pprust.rs
@@ -1704,17 +1704,11 @@ fn print_arg_mode(s: ps, m: ast::mode) {
 }
 
 fn print_bounds(s: ps, bounds: @~[ast::ty_param_bound]) {
-    if vec::len(*bounds) > 0u {
+    if bounds.is_not_empty() {
         word(s.s, ~":");
         for vec::each(*bounds) |bound| {
             nbsp(s);
-            match *bound {
-              ast::bound_copy => word(s.s, ~"Copy"),
-              ast::bound_send => word(s.s, ~"Send"),
-              ast::bound_const => word(s.s, ~"Const"),
-              ast::bound_owned => word(s.s, ~"Owned"),
-              ast::bound_trait(t) => print_type(s, t)
-            }
+            print_type(s, **bound);
         }
     }
 }