diff --git a/src/libsyntax/parse/classify.rs b/src/libsyntax/parse/classify.rs index d9f76ce3592d..b8e02556625d 100644 --- a/src/libsyntax/parse/classify.rs +++ b/src/libsyntax/parse/classify.rs @@ -30,7 +30,8 @@ pub fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool { ast::ExprKind::While(..) | ast::ExprKind::WhileLet(..) | ast::ExprKind::Loop(..) | - ast::ExprKind::ForLoop(..) => false, + ast::ExprKind::ForLoop(..) | + ast::ExprKind::Catch(..) => false, _ => true, } } diff --git a/src/test/run-pass/catch-expr.rs b/src/test/run-pass/catch-expr.rs index 5a757161a78a..310b6ea5bcc6 100644 --- a/src/test/run-pass/catch-expr.rs +++ b/src/test/run-pass/catch-expr.rs @@ -71,4 +71,10 @@ pub fn main() { Ok(&my_string) }; assert_eq!(res, Ok("test")); + + do catch { + () + } + + (); }