Using rustfmt 1.4.14-nightly (a5cb5d26 2020-04-14), this code:
fn main() {
println!("Hello!"
}
is formatted to:
fn main() {
println!("Hello!")
}
}
rustfmt prints out that there's a syntax error, exits with code zero, and breaks the file even further.
$ rustfmt < broken.rs
error: mismatched closing delimiter: `}`
--> <stdin>:3:1
|
1 | fn main() {
| - closing delimiter possibly meant for this
2 | println!("Hello!"
| - unclosed delimiter
3 | }
| ^ mismatched closing delimiter
fn main() {
println!("Hello!")
}
}
This looks to be fixed on master
error: mismatched closing delimiter: `}`
--> <stdin>:3:1
|
1 | fn main() {
| - closing delimiter possibly meant for this
2 | println!("Hello!"
| - unclosed delimiter
3 | }
| ^ mismatched closing delimiter
fn main() {
println!("Hello!")
}
Most helpful comment
This looks to be fixed on master