Skip to content

Span of macro variables points one token too early #15640

Closed
@huonw

Description

@huonw
#![feature(macro_rules)]

macro_rules! foo { () => { ($e) } }

foo!{}
macro-variable.rs:3:28: 3:29 error: unknown macro variable `e`
macro-variable.rs:3 macro_rules! foo { () => { ($e) } }
                                               ^

and if the RHS of the macro is changed to just => { $e }

macro-variable.rs:1:1: 1:1 error: unknown macro variable `e`
macro-variable.rs:1 #![feature(macro_rules)]
                    ^

Preferably this would put the error snake under the whole $... expression too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions