Skip to content

Commit 964898e

Browse files
committed
Error instead of warning for missing returns. Huzzah!
1 parent fed0486 commit 964898e

File tree

1 file changed

+2
-4
lines changed
  • src/comp/middle/tstate

1 file changed

+2
-4
lines changed

src/comp/middle/tstate/ck.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,9 @@ fn check_states_against_conditions(&fn_ctxt fcx, &_fn f, &ann a) -> () {
129129
&& ! promises(*post, fcx.id, enclosing)
130130
&& ! type_is_nil(fcx.ccx.tcx,
131131
ret_ty_of_fn(fcx.ccx.tcx, a)) ) {
132-
/* FIXME: call span_err, not span_warn, once I finish implementing
133-
! annotations */
134-
fcx.ccx.tcx.sess.span_warn(f.body.span, "In function " + fcx.name +
132+
fcx.ccx.tcx.sess.span_note(f.body.span, "In function " + fcx.name +
135133
", not all control paths return a value");
136-
fcx.ccx.tcx.sess.span_note(f.decl.output.span,
134+
fcx.ccx.tcx.sess.span_err(f.decl.output.span,
137135
"see declared return type of '" + ty_to_str(*f.decl.output) +
138136
"'");
139137
}

0 commit comments

Comments
 (0)