]> git.lizzy.rs Git - rust.git/commit
Auto merge of #34216 - jseyfried:nested_cfg_attr, r=nrc
authorbors <bors@rust-lang.org>
Thu, 16 Jun 2016 10:49:55 +0000 (03:49 -0700)
committerGitHub <noreply@github.com>
Thu, 16 Jun 2016 10:49:55 +0000 (03:49 -0700)
commit6edea2cfda2818f0a76f4bac2d18a30feb54c137
tree7e1059c82609fdf0a9560c9aa6a524d22fb821ad
parenta479a6a7a6fa1bfe1f18d7d7411ad14e7b8ca17b
parent65d256e82a26ca6e72e6668adb66a284b4ad7ba1
Auto merge of #34216 - jseyfried:nested_cfg_attr, r=nrc

Support nested `cfg_attr` attributes

Support arbitrarily deeply nested `cfg_attr` attributes (e.g. `#[cfg_attr(foo, cfg_attr(bar, baz))]`).
This makes configuration idempotent.

Currently, the nighties do not support any `cfg_attr` nesting. Stable and beta support just one level of `cfg_attr` nesting (expect for attributes on macro-expanded nodes, where no nesting is supported).

This is a [breaking-change]. For example, the following would break:
```rust
macro_rules! m { () => {
    #[cfg_attr(all(), cfg_attr(all(), cfg(foo)))]
    fn f() {}
} }
m!();

fn main() { f() } //~ ERROR unresolved name `f`
```
r? @nrc
src/libsyntax/config.rs