about summary refs log tree commit diff
path: root/src/comp/syntax/visit.rs
diff options
context:
space:
mode:
authorMarijn Haverbeke <marijnh@gmail.com>2011-11-30 13:38:38 +0100
committerMarijn Haverbeke <marijnh@gmail.com>2011-11-30 13:38:38 +0100
commitb40c6773c2f1a5a34990004cbe9b29a7575e2f7e (patch)
treee806179dd1c8f102bbc44d7268e3e855f7b97333 /src/comp/syntax/visit.rs
parent586a685eecd7786679e93cf0040a0558f47877da (diff)
downloadrust-b40c6773c2f1a5a34990004cbe9b29a7575e2f7e.tar.gz
rust-b40c6773c2f1a5a34990004cbe9b29a7575e2f7e.zip
Box ast::path values
It seems inefficient to copy them around. Let's measure whether that's actually
> the case
Diffstat (limited to 'src/comp/syntax/visit.rs')
-rw-r--r--src/comp/syntax/visit.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/comp/syntax/visit.rs b/src/comp/syntax/visit.rs
index 45249be23a6..4ba8fec9807 100644
--- a/src/comp/syntax/visit.rs
+++ b/src/comp/syntax/visit.rs
@@ -30,7 +30,7 @@ type visitor<E> =
       visit_decl: fn@(@decl, E, vt<E>),
       visit_expr: fn@(@expr, E, vt<E>),
       visit_ty: fn@(@ty, E, vt<E>),
-      visit_constr: fn@(path, span, node_id, E, vt<E>),
+      visit_constr: fn@(@path, span, node_id, E, vt<E>),
       visit_fn: fn@(_fn, [ty_param], span, fn_ident, node_id, E, vt<E>)};
 
 fn default_visitor<E>() -> visitor<E> {
@@ -149,7 +149,7 @@ fn visit_ty<E>(t: @ty, e: E, v: vt<E>) {
       ty_type. {/* no-op */ }
       ty_constr(t, cs) {
         v.visit_ty(t, e, v);
-        for tc: @spanned<constr_general_<path, node_id>> in cs {
+        for tc: @spanned<constr_general_<@path, node_id>> in cs {
             v.visit_constr(tc.node.path, tc.span, tc.node.id, e, v);
         }
       }
@@ -157,7 +157,7 @@ fn visit_ty<E>(t: @ty, e: E, v: vt<E>) {
     }
 }
 
-fn visit_constr<E>(_operator: path, _sp: span, _id: node_id, _e: E,
+fn visit_constr<E>(_operator: @path, _sp: span, _id: node_id, _e: E,
                    _v: vt<E>) {
     // default
 }
@@ -354,7 +354,7 @@ type simple_visitor =
       visit_decl: fn@(@decl),
       visit_expr: fn@(@expr),
       visit_ty: fn@(@ty),
-      visit_constr: fn@(path, span, node_id),
+      visit_constr: fn@(@path, span, node_id),
       visit_fn: fn@(_fn, [ty_param], span, fn_ident, node_id)};
 
 fn simple_ignore_ty(_t: @ty) {}
@@ -372,7 +372,7 @@ fn default_simple_visitor() -> simple_visitor {
           visit_decl: fn(_d: @decl) { },
           visit_expr: fn(_e: @expr) { },
           visit_ty: simple_ignore_ty,
-          visit_constr: fn(_p: path, _sp: span, _id: node_id) { },
+          visit_constr: fn(_p: @path, _sp: span, _id: node_id) { },
           visit_fn:
               fn(_f: _fn, _tps: [ty_param], _sp: span, _ident: fn_ident,
                   _id: node_id) {
@@ -429,8 +429,8 @@ fn mk_simple_visitor(v: simple_visitor) -> vt<()> {
         f(ty);
         visit_ty(ty, e, v);
     }
-    fn v_constr(f: fn@(path, span, node_id), pt: path, sp: span, id: node_id,
-                &&e: (), v: vt<()>) {
+    fn v_constr(f: fn@(@path, span, node_id), pt: @path, sp: span,
+                id: node_id, &&e: (), v: vt<()>) {
         f(pt, sp, id);
         visit_constr(pt, sp, id, e, v);
     }