Open
Description
Input program, which compiles:
https://play.rust-lang.org/?edition=2018&gist=046bcee6f5a6524efd1cf0d71b383fef
fn main() {
|| {
println!();
|| 0
}().to_string();
}
As of rustfmt 2.0.0-rc.1-nightly (b9138e0 2020-02-10), rustfmt incorrectly changes this to the following which does not compile:
fn main() {
|| {
{
println!();
|| 0
}()
.to_string()
};
}
It is also not idempotent, since running rustfmt again changes it to:
fn main() {
|| {
{
println!();
|| 0
}
().to_string()
};
}