Fix an error message to not refer to "block type". Closes #2423.

This commit is contained in:
Michael Sullivan 2012-05-29 12:14:44 -07:00
parent 98766e388e
commit 5d1c29912d
2 changed files with 3 additions and 2 deletions

View File

@ -15,7 +15,8 @@ fn visit_expr(ex: @expr, cx: ctx, v: visit::vt<ctx>) {
if !cx.allow_block {
alt ty::get(ty::expr_ty(cx.tcx, ex)).struct {
ty::ty_fn({proto: p, _}) if is_blockish(p) {
cx.tcx.sess.span_err(ex.span, "expressions with block type \
cx.tcx.sess.span_err(ex.span,
"expressions with stack closure type \
can only appear in callee or (by-ref) argument position");
}
_ {}

View File

@ -1,4 +1,4 @@
// error-pattern: block type can only appear
// error-pattern: stack closure type can only appear
fn lol(f: fn()) -> fn() { ret f; }
fn main() {