about summary refs log tree commit diff
path: root/src/comp
diff options
context:
space:
mode:
authorPaul Stansifer <paul.stansifer@gmail.com>2011-08-08 13:23:42 -0700
committerPaul Stansifer <paul.stansifer@gmail.com>2011-08-15 15:35:27 -0700
commite7139e28f47a7a3c4618925a8ab302d6afc644d6 (patch)
tree605033431facc4cb07521f059b3a6b16443743d3 /src/comp
parent6d39be465f77992d969a428befaa3ffcea9fe0da (diff)
downloadrust-e7139e28f47a7a3c4618925a8ab302d6afc644d6.tar.gz
rust-e7139e28f47a7a3c4618925a8ab302d6afc644d6.zip
Add a layer of boxing as a hack; this code can segfault otherwise.
Diffstat (limited to 'src/comp')
-rw-r--r--src/comp/syntax/ext/simplext.rs11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/comp/syntax/ext/simplext.rs b/src/comp/syntax/ext/simplext.rs
index 29a9c0b5345..a934df34618 100644
--- a/src/comp/syntax/ext/simplext.rs
+++ b/src/comp/syntax/ext/simplext.rs
@@ -659,7 +659,7 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
     };
 
     let macro_name: option::t[str] = none;
-    let clauses: [clause] = ~[];
+    let clauses: [@clause] = ~[];
     for arg: @expr  in args {
         alt arg.node {
           expr_vec(elts, mut, seq_kind) {
@@ -691,8 +691,9 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
                                       "macro name must not be a path");
                       }
                     }
-                    clauses += ~[{params: pattern_to_selectors(cx, invoc_arg),
-                                  body: elts.(1u)}];
+                    clauses +=
+                        ~[@{params: pattern_to_selectors(cx, invoc_arg),
+                            body: elts.(1u)}];
                     // FIXME: check duplicates (or just simplify
                     // the macro arg situation)
                   }
@@ -726,8 +727,8 @@ fn add_new_extension(cx: &ext_ctxt, sp: span, arg: @expr,
          ext: normal(ext)};
 
     fn generic_extension(cx: &ext_ctxt, sp: span, arg: @expr,
-                         body: option::t[str], clauses: [clause]) -> @expr {
-        for c: clause  in clauses {
+                         body: option::t[str], clauses: [@clause]) -> @expr {
+        for c: @clause in clauses {
             alt use_selectors_to_bind(c.params, arg) {
               some(bindings) {
                 ret transcribe(cx, bindings, c.body)