diff options
| author | Michael Sullivan <sully@msully.net> | 2011-08-31 16:15:02 -0400 |
|---|---|---|
| committer | Michael Sullivan <sully@msully.net> | 2011-08-31 16:15:02 -0400 |
| commit | 7c02517f758a20e8d5893c8b2024fbf87f7a0447 (patch) | |
| tree | 1daaeb374e2f0b52db76770712580547b7ccd5b0 /src/comp/middle/tstate | |
| parent | 722fa00681fe1d9538cb904e9a9489ac79bf7b5e (diff) | |
| download | rust-7c02517f758a20e8d5893c8b2024fbf87f7a0447.tar.gz rust-7c02517f758a20e8d5893c8b2024fbf87f7a0447.zip | |
Check all paths return properly in blocks. Closes #874.
Diffstat (limited to 'src/comp/middle/tstate')
| -rw-r--r-- | src/comp/middle/tstate/ck.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/comp/middle/tstate/ck.rs b/src/comp/middle/tstate/ck.rs index 5f899b81f88..8817a16cdd4 100644 --- a/src/comp/middle/tstate/ck.rs +++ b/src/comp/middle/tstate/ck.rs @@ -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 { |
