Check all paths return properly in blocks. Closes #874.
This commit is contained in:
parent
722fa00681
commit
7c02517f75
2 changed files with 6 additions and 1 deletions
|
|
@ -145,7 +145,7 @@ fn check_states_against_conditions(fcx: &fn_ctxt, f: &_fn,
|
|||
|
||||
/* Check that the return value is initialized */
|
||||
let post = aux::block_poststate(fcx.ccx, f.body);
|
||||
if f.proto == ast::proto_fn &&
|
||||
if f.proto != ast::proto_iter &&
|
||||
!promises(fcx, post, fcx.enclosing.i_return) &&
|
||||
!type_is_nil(fcx.ccx.tcx, ret_ty_of_fn(fcx.ccx.tcx, id)) &&
|
||||
f.decl.cf == return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue