about summary refs log tree commit diff
path: root/src/libsyntax/visit.rs
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/visit.rs
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/visit.rs')
-rw-r--r--src/libsyntax/visit.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 32fcbdfc758..b45af2d4ae8 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -264,10 +264,7 @@ fn visit_foreign_item<E>(ni: @foreign_item, e: E, v: vt<E>) {
 
 fn visit_ty_param_bounds<E>(bounds: @~[ty_param_bound], e: E, v: vt<E>) {
     for vec::each(*bounds) |bound| {
-        match *bound {
-          bound_trait(t) => v.visit_ty(t, e, v),
-          bound_copy | bound_send | bound_const | bound_owned => ()
-        }
+        v.visit_ty(**bound, e, v)
     }
 }