Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

book says $crate is a single identifier but it isn't #30217

Closed
durka opened this issue Dec 5, 2015 · 0 comments
Closed

book says $crate is a single identifier but it isn't #30217

durka opened this issue Dec 5, 2015 · 0 comments

Comments

@durka
Copy link
Contributor

durka commented Dec 5, 2015

The macros chapter says:

To keep this system simple and correct, #[macro_use] extern crate ... may only appear at the root of your crate, not inside mod. This ensures that $crate is a single identifier.

However the second sentence isn't true. $crate is either nothing or a path with one :: and one identifier. That is, this pair of macros doesn't work, either when called from within the crate or from another one:

macro_rules! b { ($i:ident) => { stringify!($i); } }
macro_rules! a { () => (b!($crate)) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants