Skip to content

Reset error counts on synthetic parser constructions #7180

Open

Description

@jieyouxu

Essentially, maybe consider wrapping invocations like

let mut parser = build_stream_parser(psess.inner(), ts);
parser.psess.dcx().reset_err_count(); // <- don't leak between different synthetic parses

Otherwise, we'd have to remember to do error count reset bookkeeping on each synthetic parse in the various macro cases.

Context: #7171 (comment)

Activity

  1. self-assigned this
    on Oct 13, 2026
  2. added
    C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE
    E-needs-investigationCall for participation: This issue or PR needs further investigation
    on Oct 13, 2026
  3. added
    needs-triageThis issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.
    on Oct 13, 2026
  4. added
    A-macrosArea: macros (procedural macros, macro_rules! macros, etc.)
    C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE
    and removed
    C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE
    needs-triageThis issue or PR needs triaging to determine its status. Remove label once sufficiently triaged.
    on Oct 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

A-macrosArea: macros (procedural macros, macro_rules! macros, etc.)A-parserArea: parserC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEE-needs-investigationCall for participation: This issue or PR needs further investigation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions