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

expand: Feature gate out-of-line modules in proc macro input #66078

Merged
merged 1 commit into from Nov 4, 2019

Conversation

@petrochenkov
Copy link
Contributor

petrochenkov commented Nov 4, 2019

Extracted from #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

#[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.

Copy link
Member

Centril left a comment

r=me p=2 with comment addressed or not if short on time.

@petrochenkov petrochenkov force-pushed the petrochenkov:gateout branch from d0f4c8b to e7cedc9 Nov 4, 2019
@petrochenkov

This comment has been minimized.

Copy link
Contributor Author

petrochenkov commented Nov 4, 2019

@bors r=Centril p=2

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 4, 2019

📌 Commit e7cedc9 has been approved by Centril

@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 4, 2019

⌛️ Testing commit e7cedc9 with merge 2477e24...

bors added a commit that referenced this pull request Nov 4, 2019
expand: Feature gate out-of-line modules in proc macro input

Extracted from #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.
@bors

This comment has been minimized.

Copy link
Contributor

bors commented Nov 4, 2019

☀️ Test successful - checks-azure
Approved by: Centril
Pushing 2477e24 to master...

@bors bors added the merged-by-bors label Nov 4, 2019
@bors bors merged commit e7cedc9 into rust-lang:master Nov 4, 2019
5 checks passed
5 checks passed
homu Test successful
Details
pr Build #20191104.27 succeeded
Details
pr (Linux mingw-check) Linux mingw-check succeeded
Details
pr (Linux x86_64-gnu-llvm-6.0) Linux x86_64-gnu-llvm-6.0 succeeded
Details
pr (Linux x86_64-gnu-tools) Linux x86_64-gnu-tools succeeded
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.