Skip to content

! is not a valid ty token in macros #8104

@alexcrichton

Description

@alexcrichton

This program:

macro_rules! foo(($t:ty) => ()) 

foo!(!)                         

fn main() {}                    

fails with

foo.rs:3:5: 3:6 error: expected type, found token NOT
foo.rs:3 foo!(!)
              ^

I ran into this when creating a condition which returned ! (not sure if that's even the right use of conditions...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    E-easyCall for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions