Skip to content
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

cfg[feature] is removed when feature name is too long #4783

Closed
Longarithm opened this issue Apr 2, 2021 · 3 comments
Closed

cfg[feature] is removed when feature name is too long #4783

Longarithm opened this issue Apr 2, 2021 · 3 comments
Labels
bug Panic, non-idempotency, invalid code, etc.

Comments

@Longarithm
Copy link

Longarithm commented Apr 2, 2021

Input

pub(crate) fn f(
    #[cfg(feature = "this_feature_name_is_long_enough_not_to_fit_inside_the_standard_limit")] x: u64,
) -> () {}

Output

pub(crate) fn f(x: u64) -> () {}

Please note that the behaviour is the same where argument is actually used. I removed its usage just for simplicity.

Meta

  • rustfmt version: rustfmt 1.4.20-stable (48f6c32 2020-08-09) or rustfmt 1.4.36-nightly (7de6968 2021-02-07)
  • From where did you install rustfmt?: rustup
  • How do you run rustfmt: cargo fmt or cargo +nightly fmt
@Longarithm Longarithm added the bug Panic, non-idempotency, invalid code, etc. label Apr 2, 2021
@Longarithm
Copy link
Author

Cc @matklad

@calebcartwright
Copy link
Member

Thanks for reaching out! This is a duplicate (though can't find the previous issue at this moment) and has already been fixed in source. Will be sure to add a test case for your input though, and pull it into the upcoming 1.4.38 release

@calebcartwright calebcartwright added 1x-backport:pending Fixed/resolved in source but not yet backported to a 1x branch and release needs-test labels Apr 4, 2021
@karyon
Copy link
Contributor

karyon commented Oct 28, 2021

duplicate of #4579, fix shipped in 1.4.38

@karyon karyon closed this as completed Oct 28, 2021
@karyon karyon removed needs-test 1x-backport:pending Fixed/resolved in source but not yet backported to a 1x branch and release labels Oct 28, 2021
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.
Projects
None yet
Development

No branches or pull requests

3 participants