-
Notifications
You must be signed in to change notification settings - Fork 13k
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
include!
ed files are unable to #[macro_use]
#28071
Labels
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
Comments
Does this perhaps have to do with #27626? |
I suppose that depends on what is considered "module root". Plain |
steveklabnik
added
the
A-macros
Area: All kinds of macros (custom derive, macro_rules!, proc macros, ..)
label
Sep 3, 2015
This is unrelated to #27626. |
bors
added a commit
that referenced
this issue
Jun 9, 2016
Support `#[macro_use]` on macro-expanded crates This PR loads macros from `#[macro_use]` crates during expansion so that - macro-expanded `#[macro_use]` crates work (fixes #33936, fixes #28071), and - macros imported from crates have the same scope as macros imported from modules. This is a [breaking-change]. For example, this will break: ```rust macro_rules! m { () => { #[macro_use(foo)] extern crate core; } //~ ERROR imported macro not found } m!(); ``` Also, this will break: ```rust macro_rules! try { () => {} } // #[macro_use] mod bar { macro_rules! try { ... } } //< ... just like this would ... fn main() { try!(); } //< ... making this an error ``` r? @nrc
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This makes using codegen a bit more cumbersome.
What happens:
main_real.rs
:main.rs
:Cargo.toml
:Attempt to build:
Moving
main_real.rs
tomain.rs
builds as expected.The text was updated successfully, but these errors were encountered: