Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#124141 preliminaries #132629

Merged
merged 4 commits into from
Nov 21, 2024
Merged

#124141 preliminaries #132629

merged 4 commits into from
Nov 21, 2024

Commits on Nov 20, 2024

  1. Introduce InvisibleOrigin on invisible delimiters.

    It's not used meaningfully yet, but will be needed to get rid of
    interpolated tokens.
    nnethercote committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    afe238f View commit details
    Browse the repository at this point in the history
  2. Add metavariables to TokenDescription.

    Pasted metavariables are wrapped in invisible delimiters, which
    pretty-print as empty strings, and changing that can break some proc
    macros. But error messages saying "expected identifer, found ``" are
    bad. So this commit adds support for metavariables in `TokenDescription`
    so they print as "metavariable" in error messages, instead of "``".
    
    It's not used meaningfully yet, but will be needed to get rid of
    interpolated tokens.
    nnethercote committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    cfafa93 View commit details
    Browse the repository at this point in the history
  3. Prepare for invisible delimiters.

    Current places where `Interpolated` is used are going to change to
    instead use invisible delimiters. This prepares for that.
    - It adds invisible delimiter cases to the `can_begin_*`/`may_be_*`
      methods and the `failed_to_match_macro` that are equivalent to the
      existing `Interpolated` cases.
    - It adds panics/asserts in some places where invisible delimiters
      should never occur.
    - In `Parser::parse_struct_fields` it excludes an ident + invisible
      delimiter from special consideration in an error message, because
      that's quite different to an ident + paren/brace/bracket.
    nnethercote committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    cee88f7 View commit details
    Browse the repository at this point in the history
  4. Remove ErrorGuaranteed retval from error_unexpected_after_dot.

    It was added in rust-lang#130349, but it's not used meaningfully, and causes
    difficulties for Nonterminal removal in rust-lang#124141.
    nnethercote committed Nov 20, 2024
    Configuration menu
    Copy the full SHA
    03159d4 View commit details
    Browse the repository at this point in the history