-
Notifications
You must be signed in to change notification settings - Fork 969
Closed
Labels
A-commentsArea: commentsArea: commentsC-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-ICEE-help-wantedCall for participation: help is requested to fix this issueCall for participation: help is requested to fix this issuegood first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors
Description
Example code:
#[repr(u8)]
enum MyEnum {
MyVariant {
/* Comment */
} = 0,
}This compiles fine.
rustfmt 1.5.2-nightly (50d3ba5 2023-02-04) inserts a line:
#[repr(u8)]
enum MyEnum {
MyVariant {
/* Comment */
} =
} = 0,
}This is a syntax error:
error: unexpected closing delimiter: `}`
--> src/main.rs:7:1
|
3 | MyVariant {
| - this delimiter might not be properly closed...
4 | /* Comment */
5 | } =
| - ...as it matches this but it has different indentation
6 | } = 0,
7 | }
| ^ unexpected closing delimiter
Metadata
Metadata
Assignees
Labels
A-commentsArea: commentsArea: commentsC-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-ICEE-help-wantedCall for participation: help is requested to fix this issueCall for participation: help is requested to fix this issuegood first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributors