Skip to content

Commit 7f7a840

Browse files
committed
---
yaml --- r: 5069 b: refs/heads/master c: 7c02517 h: refs/heads/master i: 5067: 766bb71 v: v3
1 parent a199d39 commit 7f7a840

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
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: 722fa00681fe1d9538cb904e9a9489ac79bf7b5e
2+
refs/heads/master: 7c02517f758a20e8d5893c8b2024fbf87f7a0447

trunk/src/comp/middle/tstate/ck.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ fn check_states_against_conditions(fcx: &fn_ctxt, f: &_fn,
145145

146146
/* Check that the return value is initialized */
147147
let post = aux::block_poststate(fcx.ccx, f.body);
148-
if f.proto == ast::proto_fn &&
148+
if f.proto != ast::proto_iter &&
149149
!promises(fcx, post, fcx.enclosing.i_return) &&
150150
!type_is_nil(fcx.ccx.tcx, ret_ty_of_fn(fcx.ccx.tcx, id)) &&
151151
f.decl.cf == return {
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
// error-pattern: not all control paths return
2+
fn force(f: &block() -> int) -> int { f() }
3+
fn main() {
4+
log_err force({| | });
5+
}

0 commit comments

Comments
 (0)