Closed
Description
Describe the bug
rustfmt drops block associated with a foreign function
To Reproduce
Formatting
extern "C" {
fn f() {
fn g() {}
}
}
gives
extern "C" {
fn f();
}
Context: rust-lang/rust#74204
Expected behavior
The formatting makes the code semantically correct, but causes a loss of information. I think rustfmt should preserve the block, if it has access to it.
Meta
- rustfmt version: 37ec56d
- From where did you install rustfmt?: from source
- How do you run rustfmt: binary from source