Commit Graph

1 Commits

Author SHA1 Message Date
Ayaz Hafiz
3bf67c175d Don't drop blocks on foreign functions
A code like

```rust
extern "C" {
    fn f() {
        fn g() {}
    }
}
```

is incorrect and does not compile. Today rustfmt formats this in a way
that is correct:

```rust
extern "C" {
    fn f();
}
```

But this loses information, and doesn't have to be done because we know
the content of the block if it is present. During development I don't
think rustfmt should drop the block in this context.

Closes #4313
2020-11-28 21:59:30 -06:00