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

Pass features along during expansion #22383

Merged
merged 3 commits into from
Feb 18, 2015

Conversation

pnkfelix
Copy link
Member

Pass features along during expansion

Use the set of passed features to detect uses of feature-gated macros without the corresponding feature enabled.

Fix #22234.


Also, the framework this add (passing along a reference to the features in the expansion context) is a necessary precursor for landing a properly feature-gated desugaring-based overloaded-box and placement-in (#22181).


This is fixing a bug, but since there might be code out there that is unknowingly taking advantage of that bug, I feel obligated to mark this as a:

[breaking-change]

@rust-highfive
Copy link
Collaborator

r? @huonw

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

@@ -590,11 +609,18 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::C

check(&mut cx, krate);

// FIXME (pnkfelix): Before adding the 99th entry below, change it
// to a single-pass (instead of N calls to `.has_feature`)a.
Copy link
Member

Choose a reason for hiding this comment

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

s/a//

@pnkfelix
Copy link
Member Author

ah good old tidy; that's what I get for introducing line breaks.

@huonw
Copy link
Member

huonw commented Feb 16, 2015

r=me with the comment and maybe some squashing.

The other cases: `concat_idents!`, `log_syntax!`, and `trace_macros!`,
(these macros, with `asm!`, are handled (eagerly) in feature_gate.rs).
@pnkfelix pnkfelix force-pushed the pass-features-along-during-expansion branch from a252539 to dc0797c Compare February 16, 2015 00:36
@pnkfelix
Copy link
Member Author

@bors r=huonw dc0797c

@bors
Copy link
Contributor

bors commented Feb 16, 2015

⌛ Testing commit dc0797c with merge a108a0a...

@bors
Copy link
Contributor

bors commented Feb 16, 2015

💔 Test failed - auto-win-64-opt

@alexcrichton
Copy link
Member

@bors: retry

Manishearth added a commit to Manishearth/rust that referenced this pull request Feb 17, 2015
…-expansion, r=huonw

 Pass features along during expansion

Use the set of passed features to detect uses of feature-gated macros without the corresponding feature enabled.

Fix rust-lang#22234.

----

Also, the framework this add (passing along a reference to the features in the expansion context) is a necessary precursor for landing a properly feature-gated desugaring-based overloaded-`box` and placement-`in` (rust-lang#22181).

----

This is fixing a bug, but since there might be code out there that is unknowingly taking advantage of that bug, I feel obligated to mark this as a:

[breaking-change]
@huonw huonw merged commit dc0797c into rust-lang:master Feb 18, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feature_gate::MacroVisitor misses macro invocations nested in macro invocations
5 participants