Skip to content

Commit ed1d0eb

Browse files
committed
---
yaml --- r: 14841 b: refs/heads/try c: 3a45f87 h: refs/heads/master i: 14839: 7f8a50e v: v3
1 parent 050c325 commit ed1d0eb

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: de79caa97ebfb86adaaae1c54237a94a610f94c0
5+
refs/heads/try: 3a45f87620eb04242a63544b872ed1807cd38c72
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/rustc/middle/region.rs

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,16 @@ fn resolve_expr(expr: @ast::expr, cx: ctxt, visitor: visit::vt<ctxt>) {
269269
}
270270
}
271271

272+
fn resolve_local(local: @ast::local, cx: ctxt, visitor: visit::vt<ctxt>) {
273+
alt cx.parent {
274+
pa_block(blk_id) {
275+
cx.region_map.rvalue_to_block.insert(local.node.id, blk_id);
276+
}
277+
_ { cx.sess.span_bug(local.span, "local outside of block?!"); }
278+
}
279+
visit::visit_local(local, cx, visitor);
280+
}
281+
272282
fn resolve_item(item: @ast::item, cx: ctxt, visitor: visit::vt<ctxt>) {
273283
// Items create a new outer block scope as far as we're concerned.
274284
let parent = alt item.node {
@@ -304,7 +314,8 @@ fn resolve_crate(sess: session, def_map: resolve::def_map, crate: @ast::crate)
304314
visit_ty: resolve_ty,
305315
visit_arm: resolve_arm,
306316
visit_pat: resolve_pat,
307-
visit_expr: resolve_expr
317+
visit_expr: resolve_expr,
318+
visit_local: resolve_local
308319
with *visit::default_visitor()
309320
});
310321
visit::visit_crate(*crate, cx, visitor);

0 commit comments

Comments
 (0)