Skip to content

rustfmt panics on this simple code #4509

@alexxbb

Description

@alexxbb

Describe the bug

Running rustfmt-nightly panics when encounter a space character between a type field and a method. See the example.

To Reproduce

Link to playground

You can see a whitespace character between 0. and abs() which freaks out rustfmt

Try to apply rustfmt in the playground and you'll an error.

Meta

  • rustfmt version: 1.4.21
  • From where did you install rustfmt?:
    env CFG_RELEASE_CHANNEL=nightly CFG_RELEASE=1.47.0-nightly cargo +nightly install --force rustfmt-nightly
  • How do you run rustfmt: rustfmt and via Intellij Rust plugin

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.duplicate

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions