-
Notifications
You must be signed in to change notification settings - Fork 933
Closed
Labels
bugPanic, non-idempotency, invalid code, etc.Panic, non-idempotency, invalid code, etc.good 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
bugPanic, non-idempotency, invalid code, etc.Panic, non-idempotency, invalid code, etc.good first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors