We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 78a0d38 commit 2d5b651Copy full SHA for 2d5b651
src/comp/middle/typeck.rs
@@ -1605,8 +1605,11 @@ fn check_expr(fcx: &@fn_ctxt, expr: &@ast::expr) -> bool {
1605
// A generic function for checking for or for-each loops
1606
1607
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 {
+ element_ty: ty::t, body: &ast::blk,
+ 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));
1613
let bot = check_decl_local(fcx, local);
1614
check_block(fcx, body);
1615
// Unify type of decl with element type of the seq
0 commit comments