Skip to content

Commit 9decd5e

Browse files
committed
---
yaml --- r: 4323 b: refs/heads/master c: 2d5b651 h: refs/heads/master i: 4321: b70018c 4319: 6ad4ffe v: v3
1 parent f4dbe9b commit 9decd5e

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
---
2-
refs/heads/master: 78a0d380cc276116bd995bebbee10b0144d89432
2+
refs/heads/master: 2d5b651f4981b85d0e3864d8df6bd0953578e1f4

trunk/src/comp/middle/typeck.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,8 +1605,11 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
16051605
// A generic function for checking for or for-each loops
16061606

16071607
fn check_for_or_for_each(fcx: &@fn_ctxt, local: &@ast::local,
1608-
element_ty: &ty::t, body: &ast::blk,
1609-
node_id: ast::node_id) -> bool {
1608+
element_ty: ty::t, body: &ast::blk,
1609+
node_id: ast::node_id) -> bool {
1610+
let locid = lookup_local(fcx, local.span, local.node.id);
1611+
element_ty = demand::simple(fcx, local.span, element_ty,
1612+
ty::mk_var(fcx.ccx.tcx, locid));
16101613
let bot = check_decl_local(fcx, local);
16111614
check_block(fcx, body);
16121615
// Unify type of decl with element type of the seq

0 commit comments

Comments
 (0)