-
Notifications
You must be signed in to change notification settings - Fork 972
Closed
Labels
C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEgood first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors
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)
Metadata
Metadata
Assignees
Labels
C-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICEgood first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors