summary refs log tree commit diff
path: root/src/libsyntax/visit.rs
diff options
context:
space:
mode:
authorPatrick Walton <pcwalton@mimiga.net>2012-08-06 18:54:20 -0700
committerPatrick Walton <pcwalton@mimiga.net>2012-08-06 18:55:24 -0700
commit60f47eabe2ef2730b98713dee2b5fd59513e8c6c (patch)
treecf491427dd1bfac38de4fd93d934702db9669fda /src/libsyntax/visit.rs
parentc0f7ed68e235b61a2e9710864a2283f554bb470d (diff)
downloadrust-60f47eabe2ef2730b98713dee2b5fd59513e8c6c.tar.gz
rust-60f47eabe2ef2730b98713dee2b5fd59513e8c6c.zip
rustc: Parse and stub (broken) typechecking for bounded function types
Diffstat (limited to 'src/libsyntax/visit.rs')
-rw-r--r--src/libsyntax/visit.rs19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index c988c89f8c2..08572e83f6e 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -195,8 +195,9 @@ fn visit_ty<E>(t: @ty, e: E, v: vt<E>) {
       ty_tup(ts) => for ts.each |tt| {
         v.visit_ty(tt, e, v);
       }
-      ty_fn(_, decl) => {
+      ty_fn(_, bounds, decl) => {
         for decl.inputs.each |a| { v.visit_ty(a.ty, e, v); }
+        visit_ty_param_bounds(bounds, e, v);
         v.visit_ty(decl.output, e, v);
       }
       ty_path(p, _) => visit_path(p, e, v),
@@ -251,14 +252,18 @@ 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 => ()
+        }
+    }
+}
+
 fn visit_ty_params<E>(tps: ~[ty_param], e: E, v: vt<E>) {
     for tps.each |tp| {
-        for vec::each(*tp.bounds) |bound| {
-            match bound {
-              bound_trait(t) => v.visit_ty(t, e, v),
-              bound_copy | bound_send | bound_const | bound_owned => ()
-            }
-        }
+        visit_ty_param_bounds(tp.bounds, e, v);
     }
 }