Rollup merge of #122115 - clubby789:cancel-recoverr, r=compiler-errors
Cancel parsing ever made during recovery Fixes #122112 It would be nice if diagnostics from recovery were automatically cancelled... 🤔
This commit is contained in:
commit
9bda4e47c7
3 changed files with 27 additions and 8 deletions
|
@ -787,13 +787,17 @@ impl<'a> Parser<'a> {
|
|||
let suggest_eq = if self.token.kind == token::Dot
|
||||
&& let _ = self.bump()
|
||||
&& let mut snapshot = self.create_snapshot_for_diagnostic()
|
||||
&& let Ok(_) = snapshot.parse_dot_suffix_expr(
|
||||
colon_sp,
|
||||
self.mk_expr_err(
|
||||
&& let Ok(_) = snapshot
|
||||
.parse_dot_suffix_expr(
|
||||
colon_sp,
|
||||
self.dcx().delayed_bug("error during `:` -> `=` recovery"),
|
||||
),
|
||||
) {
|
||||
self.mk_expr_err(
|
||||
colon_sp,
|
||||
self.dcx()
|
||||
.delayed_bug("error during `:` -> `=` recovery"),
|
||||
),
|
||||
)
|
||||
.map_err(Diag::cancel)
|
||||
{
|
||||
true
|
||||
} else if let Some(op) = self.check_assoc_op()
|
||||
&& op.node.can_continue_expr_unambiguously()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue