about summary refs log tree commit diff
path: root/src/rustllvm/RustWrapper.cpp
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-06-08 22:45:35 -0700
committerbors <bors@rust-lang.org>2016-06-08 22:45:35 -0700
commitdc77c5ebe80d8e8fe08b9ba05859c04f4dbb99cf (patch)
treeaf17b87c2f0a96ae5d184d750ddcb96e88fa095d /src/rustllvm/RustWrapper.cpp
parentbb4b3fb7f97924919f072ec9a360bdf943218dbf (diff)
parentdbf0326ddc041e772b5ab07b19e893e8955bf934 (diff)
downloadrust-dc77c5ebe80d8e8fe08b9ba05859c04f4dbb99cf.tar.gz
rust-dc77c5ebe80d8e8fe08b9ba05859c04f4dbb99cf.zip
Auto merge of #34032 - jseyfried:load_macros_in_expansion, r=nrc
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
Diffstat (limited to 'src/rustllvm/RustWrapper.cpp')
0 files changed, 0 insertions, 0 deletions