1
Fork 0

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:
bors 2022-06-12 23:25:35 +00:00
commit 1fb9603022
2 changed files with 3 additions and 3 deletions

View file

@ -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) => {