syntax: enable attributes and cfg on struct fields
This enables conditional compilation of field initializers in a struct literal, simplifying construction of structs whose fields are themselves conditionally present. For example, the intializer for the constant in the following becomes legal, and has the intuitive effect:
```rust
struct Foo {
#[cfg(unix)]
bar: (),
}
const FOO: Foo = Foo {
#[cfg(unix)]
bar: (),
};
```
It's not clear to me whether this calls for the full RFC process, but the implementation was simple enough that I figured I'd begin the conversation with code.
|
||
|---|---|---|
| .. | ||
| deriving | ||
| asm.rs | ||
| Cargo.toml | ||
| cfg.rs | ||
| concat.rs | ||
| concat_idents.rs | ||
| env.rs | ||
| format.rs | ||
| format_foreign.rs | ||
| lib.rs | ||
| log_syntax.rs | ||
| proc_macro_registrar.rs | ||
| trace_macros.rs | ||