about summary refs log tree commit diff
path: root/src/libsyntax
diff options
context:
space:
mode:
authorLuqman Aden <me@luqman.ca>2013-03-05 17:43:37 -0800
committerLuqman Aden <me@luqman.ca>2013-03-18 17:31:41 -0700
commit787f5bb0dbbbd50f59848f6703bd89438e60053f (patch)
tree6cf9b62600ac6b7d5fcd9aea43ad6cf8f8b68415 /src/libsyntax
parent42f95d055c2f22078f5c94c0d0ca229e1561ccb8 (diff)
downloadrust-787f5bb0dbbbd50f59848f6703bd89438e60053f.tar.gz
rust-787f5bb0dbbbd50f59848f6703bd89438e60053f.zip
Now actually allow using constants in those constant expressions for [T * n].
Diffstat (limited to 'src/libsyntax')
-rw-r--r--src/libsyntax/fold.rs4
-rw-r--r--src/libsyntax/visit.rs5
2 files changed, 6 insertions, 3 deletions
diff --git a/src/libsyntax/fold.rs b/src/libsyntax/fold.rs
index a8952f313a5..159b23f4f99 100644
--- a/src/libsyntax/fold.rs
+++ b/src/libsyntax/fold.rs
@@ -622,10 +622,10 @@ pub fn noop_fold_ty(t: &ty_, fld: @ast_fold) -> ty_ {
         }
         ty_tup(ref tys) => ty_tup(tys.map(|ty| fld.fold_ty(*ty))),
         ty_path(path, id) => ty_path(fld.fold_path(path), fld.new_id(id)),
-        ty_fixed_length_vec(ref mt, vs) => {
+        ty_fixed_length_vec(ref mt, e) => {
             ty_fixed_length_vec(
                 fold_mt(mt, fld),
-                vs
+                fld.fold_expr(e)
             )
         }
         ty_mac(ref mac) => ty_mac(fold_mac(*mac))
diff --git a/src/libsyntax/visit.rs b/src/libsyntax/visit.rs
index 6a0f1a2ec46..a159c98d21b 100644
--- a/src/libsyntax/visit.rs
+++ b/src/libsyntax/visit.rs
@@ -246,7 +246,10 @@ pub fn visit_ty<E>(t: @Ty, e: E, v: vt<E>) {
             (v.visit_ty)(f.decl.output, e, v);
         },
         ty_path(p, _) => visit_path(p, e, v),
-        ty_fixed_length_vec(ref mt, _) => (v.visit_ty)(mt.ty, e, v),
+        ty_fixed_length_vec(ref mt, ex) => {
+            (v.visit_ty)(mt.ty, e, v);
+            (v.visit_expr)(ex, e, v);
+        },
         ty_nil | ty_bot | ty_mac(_) | ty_infer => ()
     }
 }