-
Notifications
You must be signed in to change notification settings - Fork 883
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
imports_granularity=Item
removes #[cfg()]
attribute from imports
#5030
Labels
bug
Panic, non-idempotency, invalid code, etc.
help wanted
only-with-option
requires a non-default option value to reproduce
Comments
calebcartwright
added
bug
Panic, non-idempotency, invalid code, etc.
help wanted
only-with-option
requires a non-default option value to reproduce
labels
Oct 16, 2021
Thanks for the report! |
Cross linking #4991 |
narpfel
added a commit
to narpfel/rustfmt
that referenced
this issue
Oct 17, 2021
narpfel
added a commit
to narpfel/rustfmt
that referenced
this issue
Feb 25, 2022
narpfel
added a commit
to narpfel/rustfmt
that referenced
this issue
Mar 4, 2022
tommilligan
pushed a commit
to tommilligan/rustfmt
that referenced
this issue
Apr 16, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
bug
Panic, non-idempotency, invalid code, etc.
help wanted
only-with-option
requires a non-default option value to reproduce
If I format this file
with
rustfmt --config imports_granularity=Item
,rustfmt
removes thecfg
attribute:$ rustfmt --config imports_granularity=Item main.rs
Output:
This only happens if there is more than one import in the
use
statement, i. e. formattingcorrectly retains the attribute.
rustfmt
was installed viarustup
, current nightly:The text was updated successfully, but these errors were encountered: