Open
Description
Empty where clauses are semantically valid Rust. However rustfmt incorrectly removes them and comments.
Before:
trait Foo {
fn bar(&self)
where
// Self: Bar
// Some comment
;
}
fn foo<T>()
where
// T: Bar,
// Some comment
{
println!("foo");
}
After:
trait Foo {
fn bar(&self);
}
fn foo<T>() {
println!("foo");
}
rustfmt 1.4.25-stable (0f29ff6 2020-11-11)
I also tested it on master a97fd77