You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Consider this code that I don't consider to be pretty:
pubenumJmpCondition{Overflow = 0b0000,NoOverflow = 0b0001,Below/* or NotAboveOrEqual */ = 0b0010,AboveOrEqual/* or NotBelow */ = 0b0011,Equal/* or Zero */ = 0b0100,NotEqual/* or NotZero */ = 0b0101,BelowOrEqual/* or NotAbove */ = 0b0110,Above/* or NotBelowOrEqual */ = 0b0111,Sign = 0b1000,NoSign = 0b1001,ParityEven/* or Parity */ = 0b1010,ParityOdd/* or NotPar */ = 0b1011,Less/* or NotGreaterOrEqual */ = 0b1100,GreaterOrEqual/* or NotLess */ = 0b1101,LessOrEqual/* or NotGreater */ = 0b1110,Greater/* or NotLessOrEqual */ = 0b1111,}
Invoking rustfmt on this strips the comments, and while I can agree that's not the best place to put them I'd expect rustfmt will not go to destroy them.
Versions: 1.5.1 / 1.5.2-nightly.
The text was updated successfully, but these errors were encountered:
Confirming I can reproduce this with rustfmt 1.5.2-nightly (34f9ca28 2023-02-16).
The issue is that rustfmt isn't expecting to find comments in that location and doesn't try to recover them when rewriting the enum variant. I also want to highlight that this is an issue for all enum variants:
Consider this code that I don't consider to be pretty:
Invoking rustfmt on this strips the comments, and while I can agree that's not the best place to put them I'd expect rustfmt will not go to destroy them.
Versions: 1.5.1 / 1.5.2-nightly.
The text was updated successfully, but these errors were encountered: