File tree Expand file tree Collapse file tree 1 file changed +2
-3
lines changed
compiler/rustc_parse/src/parser Expand file tree Collapse file tree 1 file changed +2
-3
lines changed Original file line number Diff line number Diff line change @@ -1719,7 +1719,7 @@ impl<'a> Parser<'a> {
17191719 let capture_clause = self . parse_capture_clause ( ) ?;
17201720 let decl = self . parse_fn_block_decl ( ) ?;
17211721 let decl_hi = self . prev_token . span ;
1722- let body = match decl. output {
1722+ let mut body = match decl. output {
17231723 FnRetTy :: Default ( _) => {
17241724 let restrictions = self . restrictions - Restrictions :: STMT_EXPR ;
17251725 self . parse_expr_res ( restrictions, None ) ?
@@ -1744,8 +1744,7 @@ impl<'a> Parser<'a> {
17441744 // It is likely that the closure body is a block but where the
17451745 // braces have been removed. We will recover and eat the next
17461746 // statements later in the parsing process.
1747-
1748- return Ok ( self . mk_expr_err ( lo. to ( body. span ) ) ) ;
1747+ body = self . mk_expr_err ( body. span ) ;
17491748 }
17501749
17511750 Ok ( self . mk_expr (
You can’t perform that action at this time.
0 commit comments