提交 528c6516 编写于 作者: L Lindsey Kuper

Use span_err instead of err. Fixes issue #444.

上级 d569a71b
......@@ -2009,9 +2009,8 @@ fn check_for_or_for_each(&@stmt_ctxt scx, &@ast::decl decl,
case (none) {
auto nil = ty::mk_nil(scx.fcx.ccx.tcx);
if (!are_compatible(scx, scx.fcx.ret_ty, nil)) {
// TODO: span_err
scx.fcx.ccx.tcx.sess.err("ret; in function " +
"returning non-nil");
scx.fcx.ccx.tcx.sess.span_err(expr.span,
"ret; in function returning non-nil");
}
write::bot_ty(scx.fcx.ccx.tcx, a.id);
......
// error-pattern: ret; in function returning non-nil
fn f() {
ret;
}
fn g() -> int {
ret;
}
fn main() {
f();
g();
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册