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

Rustfmt yeets const param defaults #4816

Closed
BoxyUwU opened this issue Apr 26, 2021 · 2 comments · Fixed by #4819
Closed

Rustfmt yeets const param defaults #4816

BoxyUwU opened this issue Apr 26, 2021 · 2 comments · Fixed by #4819
Labels
1x-backport:completed bug Panic, non-idempotency, invalid code, etc.

Comments

@BoxyUwU
Copy link
Member

BoxyUwU commented Apr 26, 2021

Describe the bug
Rustfmt yeets const param defaults

playground

#![feature(const_generics_defaults)]
struct Foo<const N: usize = 5usize>;

fn main() {}

run cargo +nightly fmt or rustfmt or run the tool in playground etc and it gets formatted to:

#![feature(const_generics_defaults)]
struct Foo<const N: usize>;

fn main() {}

Expected behavior
it to not do this

Meta

  • rustfmt version: rustfmt 1.4.37-nightly (0bd2b19 2021-04-03)
  • From where did you install rustfmt?: playground/cargo
  • How do you run rustfmt: playground/cargo fmt/rustfmt
@BoxyUwU BoxyUwU added the bug Panic, non-idempotency, invalid code, etc. label Apr 26, 2021
@BoxyUwU
Copy link
Member Author

BoxyUwU commented Apr 28, 2021

I ended up getting distracted and looking into this a bit can probably PR a fix, no idea if its the "correct" fix

@calebcartwright
Copy link
Member

thank you for the report and the corresponding PR! i've got a lot of issue/PR catch up to get through but will hopefully get to it shortly

@calebcartwright calebcartwright added the 1x-backport:pending Fixed/resolved in source but not yet backported to a 1x branch and release label Jun 10, 2021
@calebcartwright calebcartwright added 1x-backport:completed and removed 1x-backport:pending Fixed/resolved in source but not yet backported to a 1x branch and release labels Aug 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1x-backport:completed bug Panic, non-idempotency, invalid code, etc.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants