Skip to content

Lifetime token needs to be considered can_begin_expr #51481

Closed
@dtolnay

Description

@dtolnay

I would expect the expression 'a: while false {} to be accepted by a $:expr matcher.

macro_rules! m {
    ($e:expr) => {};
}

fn main() {
    // okay
    let _ = 'a: while false {};

    // no rules expected the token `'a`
    m!('a: while false {});
}

cc @kennytm

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-macrosArea: All kinds of macros (custom derive, macro_rules!, proc macros, ..)C-bugCategory: This is a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions