Skip to content

rustfmt on impl with const generic adds unwanted code #3601

Closed
@hellow554

Description

@hellow554

Before formatting:

trait A {}
pub struct B<const N: usize>([usize; N]);

impl<const N: usize> A for B<{ N }> { }

After formatting:

trait A {}
pub struct B<const N: usize>([usize; N]);

impl<const N: usize> A for B<{ N }> { N }> {}

Used 1.2.2 nightly (2019-04-24 5274b49)

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugPanic, non-idempotency, invalid code, etc.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions