- Notifications
You must be signed in to change notification settings - Fork 970
Labels
A-commentsArea: commentsArea: commentsA-matchesArea: match arms, patterns, blocks, etcArea: match arms, patterns, blocks, etcC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE
Description
Using rustfmt 1.7.1-stable (eeb90cda 2024-09-04), In the following example:
fn main() { let x: Option<i32> = Some(10); let value = match x { Some(i) => i /* comment */, None => 0 }; println!("{}", value); }Rustfmt adds an additional comma before the block comment, which causes the following error:
error: expected pattern, found `,` --> src/test.rs:4:36 | 4 | Some(i) => i, /* comment */, | ^ expected pattern error: aborting due to 1 previous error TheBestTvarynka
Metadata
Metadata
Assignees
Labels
A-commentsArea: commentsArea: commentsA-matchesArea: match arms, patterns, blocks, etcArea: match arms, patterns, blocks, etcC-bugCategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICECategory: this is a bug; use also I-* labels for specific bug kinds, e.g. I-non-idempotency or I-ICE