]> git.lizzy.rs Git - rust.git/commitdiff
use mk_expr_err more
authorMazdak Farrokhzad <twingoow@gmail.com>
Tue, 3 Dec 2019 14:32:05 +0000 (15:32 +0100)
committerMazdak Farrokhzad <twingoow@gmail.com>
Fri, 20 Dec 2019 21:41:29 +0000 (22:41 +0100)
src/librustc_parse/parser/expr.rs

index 9a22641ce81ac73a7ecdc782799860098c9f69b8..955cdb7b8e3bd4b45b0b5570465ec04b81a613d2 100644 (file)
@@ -890,7 +890,7 @@ fn parse_bottom_expr(&mut self) -> PResult<'a, P<Expr>> {
                     //     2 |     foo(bar(;
                     //       |             ^ expected expression
                     self.bump();
-                    Ok(self.mk_expr(self.token.span, ExprKind::Err, ThinVec::new()))
+                    Ok(self.mk_expr_err(self.token.span))
                 } else if self.token.span.rust_2018() {
                     // `Span::rust_2018()` is somewhat expensive; don't get it repeatedly.
                     if self.check_keyword(kw::Async) {