Skip to content

Rustfmt inserts a made-up impl Trait definition into types #5086

@dtolnay

Description

@dtolnay

As of current master, rustfmt applies the following incorrect diff to this valid Rust code:

  #[cfg(any())]
- type Type: Bound;
+ type Type: Bound = impl Bound;

To reproduce: cargo run --bin rustfmt repro.rs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions