diff options
| author | bors <bors@rust-lang.org> | 2016-10-21 01:48:31 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-10-21 01:48:31 -0700 |
| commit | da5b6467c33f7f86b4964b08b37726f7611a8f0c (patch) | |
| tree | bda505a46fc98c456aa2012b41af936d99fb1a79 /src/librustc_resolve | |
| parent | e4708273b5401cd572d19f8836e121ce39dc2767 (diff) | |
| parent | b283aaf0ff74db93162b402e627f3b4ed7fb7d4e (diff) | |
| download | rust-da5b6467c33f7f86b4964b08b37726f7611a8f0c.tar.gz rust-da5b6467c33f7f86b4964b08b37726f7611a8f0c.zip | |
Auto merge of #37247 - jseyfried:future_proof_no_link, r=nrc
macros: Future proof `#[no_link]`
This PR future proofs `#[no_link]` for macro modularization (cc #35896).
First, we resolve all `#[no_link] extern crate`s. `#[no_link]` crates without `#[macro_use]` or `#[macro_reexport]` are not resolved today, this is a [breaking-change]. For example,
```rust
```
Any breakage can be fixed by simply removing the `#[no_link] extern crate`.
Second, `#[no_link] extern crate`s will define an empty module in type namespace to eventually allow importing the crate's macros with `use`. This is a [breaking-change], for example:
```rust
mod syntax {} //< This becomes a duplicate error.
```
r? @nrc
Diffstat (limited to 'src/librustc_resolve')
| -rw-r--r-- | src/librustc_resolve/build_reduced_graph.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/librustc_resolve/build_reduced_graph.rs b/src/librustc_resolve/build_reduced_graph.rs index f19afd67faa..9ed7be5af4e 100644 --- a/src/librustc_resolve/build_reduced_graph.rs +++ b/src/librustc_resolve/build_reduced_graph.rs @@ -267,7 +267,7 @@ impl<'b> Resolver<'b> { } self.populate_module_if_necessary(module); - } else if custom_derive_crate { + } else { // Define an empty module let def = Def::Mod(self.definitions.local_def_id(item.id)); let module = ModuleS::new(Some(parent), ModuleKind::Def(def, name)); |
