parse_and_disallow_postfix_after_cast: account for ExprKind::Err.
This commit is contained in:
parent
0afdf43dc1
commit
96d7353678
3 changed files with 12 additions and 0 deletions
|
|
@ -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"),
|
||||
}
|
||||
);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,3 @@
|
|||
fn main() {
|
||||
expr as fun()(:); //~ ERROR expected expression
|
||||
}
|
||||
|
|
@ -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
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue