]> git.lizzy.rs Git - rust.git/commitdiff
Auto merge of #66078 - petrochenkov:gateout, r=Centril
authorbors <bors@rust-lang.org>
Mon, 4 Nov 2019 12:16:00 +0000 (12:16 +0000)
committerbors <bors@rust-lang.org>
Mon, 4 Nov 2019 12:16:00 +0000 (12:16 +0000)
expand: Feature gate out-of-line modules in proc macro input

Extracted from https://github.com/rust-lang/rust/pull/64273.

We are currently gating attributes applied directly to `mod` items because there are unresolved questions about out-of-line modules and their behavior is very likely to change.

However, you can sneak an out-of-line module into an attribute macro input using modules nested into other items like
```rust
#[my_attr]
fn m() {
    #[path = "zzz.rs"]
    mod n; // what tokens does the `my_attr` macro see?
}
```
This PR prevents that and emits a feature gate error for this case as well.

r? @Centril
It would be great to land this before beta.


Trivial merge