Auto merge of #98020 - TaKO8Ki:use-create-snapshot-for-diagnostic-in-rustc-expand, r=Dylan-DPC
Use `create_snapshot_for_diagnostic` instead of `clone` for `Parser`
Use [`create_snapshot_for_diagnostic`](cd11905716/compiler/rustc_parse/src/parser/diagnostics.rs (L214-L223)
) I implemented in https://github.com/rust-lang/rust/pull/94731 instead of `clone` to avoid duplicate unclosed delims errors being emitted when the `Parser` is dropped. I missed this one in #95068.
This commit is contained in:
commit
1fb9603022
2 changed files with 3 additions and 3 deletions
|
@ -123,7 +123,7 @@ impl<'a> ParserAnyMacro<'a> {
|
|||
is_trailing_mac,
|
||||
is_local,
|
||||
} = *self;
|
||||
let snapshot = &mut parser.clone();
|
||||
let snapshot = &mut parser.create_snapshot_for_diagnostic();
|
||||
let fragment = match parse_ast_fragment(parser, kind) {
|
||||
Ok(f) => f,
|
||||
Err(err) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue