]> git.lizzy.rs Git - rust.git/commitdiff
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)
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

1  2 
src/libsyntax/config.rs

Simple merge