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

Can't use a custom proc_macro_attribute at crate root #42699

Closed
DanielShaulov opened this issue Jun 16, 2017 · 2 comments
Closed

Can't use a custom proc_macro_attribute at crate root #42699

DanielShaulov opened this issue Jun 16, 2017 · 2 comments

Comments

@DanielShaulov
Copy link

I have a proc-macro crate mycrate, that defines a #[proc_macro_attribute] function mymacro.
There is no way to use it (that I could find) at crate root level

I tried this code:

#![feature(proc_macro)]
extern crate mycrate;
#![mycrate::mymacro]

And I get the following error:
error: an inner attribute is not permitted in this context
As I understand this is because I use it after the extern crate, but it won't resolve before it.

(I know this feature is not stable yet, just want to know if there is a plan/workaround for this)

Meta

rustc --version --verbose:

rustc 1.19.0-nightly (554c685b0 2017-06-14)
binary: rustc
commit-hash: 554c685b0b3b25b7aa752717edf50b8d6bcab7a0
commit-date: 2017-06-14
host: x86_64-pc-windows-msvc
release: 1.19.0-nightly
LLVM version: 4.0
@kennytm
Copy link
Member

kennytm commented Jun 16, 2017

Duplicate of #41430?

@Mark-Simulacrum
Copy link
Member

I believe so, yes. Closing.

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

3 participants