Skip to content

Commit

Permalink
Rollup merge of #70556 - Centril:fix-70552, r=estebank
Browse files Browse the repository at this point in the history
parse_and_disallow_postfix_after_cast: account for `ExprKind::Err`.

Fixes #70552.

r? @estebank
cc @daboross
  • Loading branch information
Dylan-DPC authored Mar 31, 2020
2 parents 8993358 + 96d7353 commit 81f19ec
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/librustc_parse/parser/expr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -638,6 +638,7 @@ impl<'a> Parser<'a> {
ExprKind::MethodCall(_, _) => "a method call",
ExprKind::Call(_, _) => "a function call",
ExprKind::Await(_) => "`.await`",
ExprKind::Err => return Ok(with_postfix),
_ => unreachable!("parse_dot_or_call_expr_with_ shouldn't produce this"),
}
);
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fn main() {
expr as fun()(:); //~ ERROR expected expression
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
error: expected expression, found `:`
--> $DIR/issue-70552-ascription-in-parens-after-call.rs:2:19
|
LL | expr as fun()(:);
| ^ expected expression

error: aborting due to previous error

0 comments on commit 81f19ec

Please sign in to comment.