Skip to content

Document how tokens are compared in declarative macros #2315

Description

@bal-e

I wondered whether something like this would compile:

macro_rules! foo {
    ( r###"hello"### ) => {}; // 3 #-es
}

foo!( r##"hello"## ); // 2 #-es

It appears it does not, but this is not documented on the reference chapter about Macros By Example. There should be a section explaining the exact rules by which tokens are compared; there may be existing code out there that relies on behavior like this. Other examples I can think of:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions