Illformed derive is removed #4029
Labels
bug
Panic, non-idempotency, invalid code, etc.
good first issue
Issues up for grabs, also good candidates for new rustfmt contributors
When I wrote the following code:
it got reformatted as
#[derive()]
, i.e. the traits were removed automatically.Since my editor did formatting on save, the code was always altered before I could try to compile it (which would have shown me the syntax error) and thus I had to stare at the code for some time until I figured it out (sometimes such obvious errors don't reach your brain). It is not directly obvious, why the derived traits are removed on
Ctrl+s
😄I expected rustfmt to not alter the code on such syntax errors.
This issue is similar to #3898.
Reproduction
Tested versions are:
The text was updated successfully, but these errors were encountered: