-
Notifications
You must be signed in to change notification settings - Fork 996
Closed
Closed
Copy link
Labels
C-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 issueP-lowLow priorityLow prioritygood first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributorsonly-with-optionRequires a non-default option value to reproduceRequires a non-default option value to reproduce
Description
If I have a struct type with an implicit field such as
struct MyStruct(u64);
And I attempt to initialize it to 0
let instance = MyStruct { 0: 0 };
With the option "use_field_init_shorthand = true", rustfmt will incorrectly shorten the initialization to:
let instance = MyStruct { 0 };
This code will no longer compile after running rustfmt.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
C-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 issueP-lowLow priorityLow prioritygood first issueIssues up for grabs, also good candidates for new rustfmt contributorsIssues up for grabs, also good candidates for new rustfmt contributorsonly-with-optionRequires a non-default option value to reproduceRequires a non-default option value to reproduce