Skip to content

comment in const generic default causes line duplication #5668

@oli-obk

Description

@oli-obk
type Foo = impl Send;
struct Struct<
    const C: usize = {
        let _: Foo = ();
        //~^ ERROR: mismatched types
        0
    },
>;

gets formatted to

type Foo = impl Send;
struct Struct<
    const C: usize = {
        let _: Foo = ();
        //~^ ERROR: mismatched types
        0
    },
>
;
//~^ ERROR: mismatched types
0
},
>;

Without the comment, the formatting doesn't change.

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