Skip to content

Document $crate in macro matcher #588

@ehuss

Description

@ehuss

$crate in a macro matcher is the reserved identifier $crate that doesn't have a way to write it outside of a macro (I think?). That is:

macro_rules! m {
    (x) => {
        m!($crate:tt)
    };
    ($crate:tt) => ()
}

fn main() {
    m!(x); // OK
    m!(y); // ERROR
    m!($crate:tt); // ERROR
    m!(crate:tt); // ERROR
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions