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

resolve: Do not error on access to proc macros imported with #[macro_use] #53461

Merged
merged 1 commit into from
Sep 16, 2018

Conversation

petrochenkov
Copy link
Contributor

@petrochenkov petrochenkov commented Aug 17, 2018

This error is artificial, but previously, when #[macro_use] extern crate x; was stable, but non-derive proc macros were not, it worked like kind of a feature gate. Now both features are stable, so the error is no longer necessary.

This PR simplifies how #[macro_use] extern crate x; works - it takes all items from macro namespace of x's root and puts them into macro prelude from which they all can now be accessed.

@rust-highfive
Copy link
Collaborator

r? @aturon

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Aug 17, 2018
@petrochenkov
Copy link
Contributor Author

r? @alexcrichton

@rust-highfive rust-highfive assigned alexcrichton and unassigned aturon Aug 17, 2018
@alexcrichton
Copy link
Member

While this seems plausible to me, I'd defer to @rust-lang/lang in this regard as it's moreso a language change they'd likely wish to discuss.

Folks on @rust-lang/lang, how do you feel about #[macro_use], a hopefully legacy attribute soon, working for new shiny new procedural macro attributes we've stabilized?

@Centril Centril added I-nominated T-lang Relevant to the language team, which will review and decide on the PR/issue. labels Aug 20, 2018
@joshtriplett
Copy link
Member

Given that we're moving towards using use for macros, and use works for procedural macros, do we want to make #[macro_use] work for this?

@petrochenkov
Copy link
Contributor Author

petrochenkov commented Aug 20, 2018

Given that #[macro_use] extern crate ... is being retired, I'd say that it largely doesn't matter from language usability point of view whether this case is allowed or not.
My primary motivation for doing this is simplification of the rules and removal of technical debt from the compiler.

@joshtriplett
Copy link
Member

@petrochenkov Fair enough. Sounds reasonable to me.

@Centril
Copy link
Contributor

Centril commented Aug 21, 2018

I also think it sounds reasonable :)
...we should discuss this further on the meeting,
...but to expedite things, let's:

@rfcbot fcp merge

@rfcbot
Copy link

rfcbot commented Aug 21, 2018

Team member @Centril has proposed to merge this. The next step is review by the rest of the tagged teams:

No concerns currently listed.

Once a majority of reviewers approve (and none object), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up!

See this document for info about what commands tagged team members can give me.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Aug 21, 2018
@bors
Copy link
Contributor

bors commented Aug 21, 2018

☔ The latest upstream changes (presumably #53471) made this pull request unmergeable. Please resolve the merge conflicts.

@pietroalbini pietroalbini added S-waiting-on-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Aug 27, 2018
@scottmcm
Copy link
Member

scottmcm commented Sep 6, 2018

If this is just allowing the compiler to delete code, not changing idioms,

@rfcbot reviewed

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels Sep 6, 2018
@rfcbot
Copy link

rfcbot commented Sep 6, 2018

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot added final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. and removed proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. labels Sep 6, 2018
@rfcbot
Copy link

rfcbot commented Sep 16, 2018

The final comment period, with a disposition to merge, as per the review above, is now complete.

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels Sep 16, 2018
@petrochenkov
Copy link
Contributor Author

Yay, FCP complete.
@bors r=alexcrichton

@bors
Copy link
Contributor

bors commented Sep 16, 2018

📌 Commit e411bb3 has been approved by alexcrichton

@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-team Status: Awaiting decision from the relevant subteam (see the T-<team> label). labels Sep 16, 2018
@bors
Copy link
Contributor

bors commented Sep 16, 2018

⌛ Testing commit e411bb3 with merge cb6d2df...

bors added a commit that referenced this pull request Sep 16, 2018
resolve: Do not error on access to proc macros imported with `#[macro_use]`

This error is artificial, but previously, when `#[macro_use] extern crate x;` was stable, but non-derive proc macros were not, it worked like kind of a feature gate. Now both features are stable, so the error is no longer necessary.

This PR simplifies how `#[macro_use] extern crate x;` works - it takes all items from macro namespace of `x`'s root and puts them into macro prelude from which they all can now be accessed.
@bors
Copy link
Contributor

bors commented Sep 16, 2018

☀️ Test successful - status-appveyor, status-travis
Approved by: alexcrichton
Pushing cb6d2df to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-lang Relevant to the language team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants