Skip to content

Doc of gereric items format error #5122

@frank-king

Description

@frank-king
struct Foo<
    /// doc of T
    T,
    /// doc of N
    const N: u32,
>;

After rustfmt, it becomes

struct Foo<
    /// doc of T T,
    /// doc of N
    /// doc of N const N: u32,
>;

Occurred both on rustfmt 1.4.37-stable (2021-11-01) and 1.4.38-nightly (2021-12-02).

BTW, though fresh new to rustc and rustfmt, I'm interested in rust toolchains and would like to try fixing it on my own. Unless it blocks or I cannot fix it in two or three weeks, anyone else can pick it up.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions