Closed
Description
rust-lang/rust#38814 added struct_field_attributes
to Rust, however,
the file:
#![feature(struct_field_attributes)]
struct Foo {
bar: u64,
#[cfg(test)]
qux: u64,
}
fn do_something() -> Foo {
Foo {
bar: 0,
#[cfg(test)]
qux: 1
}
}
fn main() {
do_something();
}
gets formatted to
#![feature(struct_field_attributes)]
struct Foo {
bar: u64,
#[cfg(test)]
qux: u64,
}
fn do_something() -> Foo {
Foo { bar: 0, qux: 1 }
}
fn main() {
do_something();
}
which does not compile (it's lost the #[cfg(test)]
in do_something
)