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

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.

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Nov 4, 2019
Copy link
Contributor

@Centril Centril left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@petrochenkov
Copy link
Contributor Author

@bors r=Centril p=2

@bors
Copy link
Contributor

bors commented Nov 4, 2019

📌 Commit e7cedc9 has been approved by Centril

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 4, 2019
@bors
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
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 This PR was explicitly merged by bors. label Nov 4, 2019
@bors bors merged commit e7cedc9 into rust-lang:master Nov 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants