diff --git a/src/comp/front/parser.rs b/src/comp/front/parser.rs index 104c2c6f71a..34162a44f75 100644 --- a/src/comp/front/parser.rs +++ b/src/comp/front/parser.rs @@ -898,7 +898,6 @@ fn parse_bottom_expr(parser p) -> @ast::expr { ex = expand_syntax_ext(p, es.span, pth, es.node, none[str]); } else if (eat_word(p, "fail")) { - p.bump(); ex = ast::expr_fail(p.get_ann()); } else if (eat_word(p, "log")) { auto e = parse_expr(p); diff --git a/src/test/compile-fail/fail-simple.rs b/src/test/compile-fail/fail-simple.rs new file mode 100644 index 00000000000..a8c4934aa0c --- /dev/null +++ b/src/test/compile-fail/fail-simple.rs @@ -0,0 +1,6 @@ +// -*- rust -*- + +// error-pattern: after expression but found +fn main() { + fail @ ; +} diff --git a/src/test/run-pass/parse-fail.rs b/src/test/run-pass/parse-fail.rs new file mode 100644 index 00000000000..4e8b410036b --- /dev/null +++ b/src/test/run-pass/parse-fail.rs @@ -0,0 +1,8 @@ +// -*- rust -*- + +fn dont_call_me() { + fail; + log 1; +} + +fn main() {} \ No newline at end of file