Skip to content

Commit 13ac023

Browse files
committed
always return ExprKind::Err
1 parent 9ed5267 commit 13ac023

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

compiler/rustc_parse/src/parser/diagnostics.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1717,12 +1717,7 @@ impl<'a> Parser<'a> {
17171717
self.recover_await_prefix(await_sp)?
17181718
};
17191719
let sp = self.error_on_incorrect_await(lo, hi, &expr, is_question);
1720-
let kind = match expr.kind {
1721-
// Avoid knock-down errors as we don't know whether to interpret this as `foo().await?`
1722-
// or `foo()?.await` (the very reason we went with postfix syntax 😅).
1723-
ExprKind::Try(_) => ExprKind::Err,
1724-
_ => ExprKind::Await(expr, await_sp),
1725-
};
1720+
let kind = ExprKind::Err;
17261721
let expr = self.mk_expr(lo.to(sp), kind);
17271722
self.maybe_recover_from_bad_qpath(expr)
17281723
}

0 commit comments

Comments
 (0)