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
|
@ -40,7 +40,8 @@ impl<'a> Parser<'a> {
|
|||
|
||||
/// If `force_collect` is [`ForceCollect::Yes`], forces collection of tokens regardless of whether
|
||||
/// or not we have attributes
|
||||
pub(crate) fn parse_stmt_without_recovery(
|
||||
// Public for `cfg_eval` macro expansion.
|
||||
pub fn parse_stmt_without_recovery(
|
||||
&mut self,
|
||||
capture_semi: bool,
|
||||
force_collect: ForceCollect,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue