Skip to content

Strip configuration before checking feature gates of macros #24437

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

Merged
merged 1 commit into from
Apr 16, 2015

Conversation

fhahn
Copy link
Contributor

@fhahn fhahn commented Apr 14, 2015

closes #24434

This PR changes executes syntax::config::strip_unconfigured_items before syntax::feature_gate::check_crate_macros(sess.codemap(). As far as I know, strip_unconfigured_items should be independent of check_crate_macros.

@rust-highfive
Copy link
Contributor

r? @pcwalton

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

@alexcrichton
Copy link
Member

This does have the consequence of the compiler accepting more programs than before. For example if you have something like:

#[cfg(foo)]
#[foo]
fn foo() {}

This is rejected today but will be accepted with this patch. I think it's consistent with how we generally deal with #[cfg]'d code, however, so I'm totally fine with that!

@bors: r+ 7350ce8

Thanks!

@bors
Copy link
Collaborator

bors commented Apr 16, 2015

⌛ Testing commit 7350ce8 with merge ac2b6f6...

bors added a commit that referenced this pull request Apr 16, 2015
closes #24434 

This PR changes executes `syntax::config::strip_unconfigured_items` before `syntax::feature_gate::check_crate_macros(sess.codemap()`. As far as I know, `strip_unconfigured_items` should be independent of `check_crate_macros`.
@bors bors merged commit 7350ce8 into rust-lang:master Apr 16, 2015
@fhahn fhahn deleted the issue-24434 branch April 16, 2015 19:28
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.

Configuration stripping should happen before checking feature gates
5 participants