Rollup merge of #111054 - cjgillot:cfg-eval-recover, r=b-naber
Do not recover when parsing stmt in cfg-eval. `parse_stmt` does recovery on its own. When parsing the statement fails, we always get `Ok(None)` instead of an `Err` variant with the diagnostic that we can emit. To avoid this behaviour, we need to opt-out of recovery for cfg_eval. Fixes https://github.com/rust-lang/rust/issues/105228
This commit is contained in:
commit
ee26abdafb
4 changed files with 38 additions and 2 deletions
|
@ -166,7 +166,9 @@ impl CfgEval<'_, '_> {
|
|||
))
|
||||
},
|
||||
Annotatable::Stmt(_) => |parser| {
|
||||
Ok(Annotatable::Stmt(P(parser.parse_stmt(ForceCollect::Yes)?.unwrap())))
|
||||
Ok(Annotatable::Stmt(P(parser
|
||||
.parse_stmt_without_recovery(false, ForceCollect::Yes)?
|
||||
.unwrap())))
|
||||
},
|
||||
Annotatable::Expr(_) => {
|
||||
|parser| Ok(Annotatable::Expr(parser.parse_expr_force_collect()?))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue