rust-lang / reference

The Rust Reference
https://doc.rust-lang.org/nightly/reference/
Apache License 2.0
1.23k stars 479 forks source link

Split `$crate` into two tokens. #587

Open ehuss opened 5 years ago

ehuss commented 5 years ago

The grammar rules should be clear that $ crate is two tokens. I think putting a space between them would be sufficient (such as in paths.md)

petrochenkov commented 5 years ago

This is tricky. $ crate is two tokens in macro_rules input, but it turns into a single identifier token in the macro output after the macro is expanded, see https://github.com/rust-lang/rust/issues/55640 for more details.