@@ -205,10 +205,10 @@ fn transcribe(cx: ext_ctxt, b: bindings, body: @expr) -> @expr {
205
205
206
206
207
207
/* helper: descend into a matcher */
208
- fn follow ( m : arb_depth < matchable > , idx_path : @ mut ~ [ uint ] ) ->
208
+ pure fn follow ( m : arb_depth < matchable > , idx_path : & [ uint ] ) ->
209
209
arb_depth < matchable > {
210
210
let mut res: arb_depth < matchable > = m;
211
- for vec:: each( * idx_path) |idx| {
211
+ for vec:: each( idx_path) |idx| {
212
212
res = match res {
213
213
leaf( _) => return res, /* end of the line */
214
214
seq( new_ms, _) => new_ms[ idx]
@@ -222,7 +222,7 @@ fn follow_for_trans(cx: ext_ctxt, mmaybe: option<arb_depth<matchable>>,
222
222
match mmaybe {
223
223
none => return none,
224
224
some( m) => {
225
- return match follow ( m, idx_path) {
225
+ return match follow ( m, * idx_path) {
226
226
seq( _, sp) => {
227
227
cx. span_fatal ( sp,
228
228
~"syntax matched under ... but not " +
@@ -274,7 +274,8 @@ fn transcribe_exprs(cx: ext_ctxt, b: bindings, idx_path: @mut ~[uint],
274
274
/* we need to walk over all the free vars in lockstep, except for
275
275
the leaves, which are just duplicated */
276
276
do free_vars( b, repeat_me) |fv| {
277
- let cur_pos = follow ( b. get ( fv) , idx_path) ;
277
+ let fv_depth = b. get ( fv) ;
278
+ let cur_pos = follow ( fv_depth, * idx_path) ;
278
279
match cur_pos {
279
280
leaf( _) => ( ) ,
280
281
seq( ms, _) => {
0 commit comments