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

Not formatting when it should #4589

Closed
bjorn3 opened this issue Dec 13, 2020 · 1 comment
Closed

Not formatting when it should #4589

bjorn3 opened this issue Dec 13, 2020 · 1 comment

Comments

@bjorn3
Copy link
Member

bjorn3 commented Dec 13, 2020

Describe the bug

In rust-lang/rust#79553 (comment) something roughly equivalent to the following was not formatted to how to should:

enum Foo {
    Bar {
        foo_bar: bool,
        baz: u8 },
}

The }, should be on a new line.

To Reproduce

Run ./x.py fmt on the rust repo as of rust-lang/rust@5bd9b60. The offending line is line 60 of compiler/rustc_mir_build/src/build/expr/as_place.rs.

Expected behavior

See "Describe the bug"

Meta

  • rustfmt version: rustfmt 1.4.27-nightly (580d826 2020-11-16)
  • From where did you install rustfmt?: The rust build system
  • How do you run rustfmt: ./x.py fmt
@bjorn3 bjorn3 added the bug Panic, non-idempotency, invalid code, etc. label Dec 13, 2020
@calebcartwright calebcartwright removed the bug Panic, non-idempotency, invalid code, etc. label Dec 13, 2020
@calebcartwright
Copy link
Member

Left a comment on the linked PR, but closing this as it seems the referenced nonformatting is due to the ignore configuration within the r-l/rust repo.

If you run rustfmt directly, using stable, nightly, and/or rustfmt from source, you'll see it formatted fine both with the snippet in this issue description and the referenced snipped in the linked PR, demonstrable at the Playground link below.

Closing accordingly, but can certainly reopen if there turns out to be anything with rustfmt itself

https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=ce4aab0185308555b2e4eca4507c5114

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants