Open
Description
Example code (playground link)
fn main() {
match 100 {
0 => println!("its zero")
// eprintln!("its zero")
,
_ => (),
}
}
After format with rustfmt 1.5.2-stable (90c5418 2023-05-31)
:
fn main() {
match 100 {
0 => println!("its zero"),
// eprintln!("its zero")
,
_ => (),
}
}
A comma is inserted after the println! call, causing this syntax error:
Compiling playground v0.0.1 (/playground)
error: expected pattern, found `,`
--> src/main.rs:5:9
|
5 | ,
| ^ expected pattern
error: could not compile `playground` (bin "playground") due to previous error