Lokasi ngalangkungan proxy:   [ UP ]  
[Ngawartoskeun bug]   [Panyetelan cookie]                
Skip to content

Incorrect span when encountering incorrect opening delimiter in macro fragments #55322

Closed

Description

@estebank

When writing a macro rule that tries to accept a () after a path, we correctly inform the user that ( cannot come after a path, but we point at the following character:

error: `$p:path` is followed by `(`, which is not allowed for `path` fragments
  --> $DIR/macro-follow.rs:104:15
   |
LL |     ($p:path ()) => {};
   |               ^

This is probably an off-by-one error in the span assignment of the tokens.

Activity

  1. added
    A-diagnostics
    A-macros
    on Oct 24, 2018
  2. added
    C-enhancement
    T-compiler
    on Jun 11, 2020
  3. estebank commented on Aug 30, 2020

    @estebank
    ContributorAuthor

    Fixed:

    error: `$p:path` is followed by `(`, which is not allowed for `path` fragments
     --> src/lib.rs:2:14
      |
    2 |     ($p:path ()) => {};
      |              ^ not allowed after `path` fragments
      |
      = note: allowed there are: `{`, `[`, `=>`, `,`, `>`, `=`, `:`, `;`, `|`, `as` or `where`
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsA-macrosC-enhancementT-compiler

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions