diff options
| author | Marijn Haverbeke <[email protected]> | 2011-05-11 13:49:48 +0200 |
|---|---|---|
| committer | Marijn Haverbeke <[email protected]> | 2011-05-11 13:49:48 +0200 |
| commit | 7d086df0954263c2667fb4af65ab82b7e39d51ca (patch) | |
| tree | bd06812266869df9b19cbf3529e9c5ef4fe54010 /src/comp/middle | |
| parent | Hash only on def_num when storing def_ids that are local (diff) | |
| download | rust-7d086df0954263c2667fb4af65ab82b7e39d51ca.tar.xz rust-7d086df0954263c2667fb4af65ab82b7e39d51ca.zip | |
Stop depending on block indices in capture.rs
Diffstat (limited to 'src/comp/middle')
| -rw-r--r-- | src/comp/middle/capture.rs | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/comp/middle/capture.rs b/src/comp/middle/capture.rs index d61edaca..89948b4d 100644 --- a/src/comp/middle/capture.rs +++ b/src/comp/middle/capture.rs @@ -79,11 +79,15 @@ fn walk_expr(@env e, &@ast.expr x) { } fn walk_block(@env e, &ast.block b) { - for each (@tup(ast.ident, ast.block_index_entry) it in - b.node.index.items()) { - alt (it._1) { - case (ast.bie_local(?local)) { - e.idmap.insert(local.id, current_context(*e)); + for (@ast.stmt st in b.node.stmts) { + alt (st.node) { + case (ast.stmt_decl(?d,_)) { + alt (d.node) { + case (ast.decl_local(?loc)) { + e.idmap.insert(loc.id, current_context(*e)); + } + case (_) { } + } } case (_) { } } |