Skip to content

/* comment */ inside trait generics gets duplicated #5358

@xhalo32

Description

@xhalo32
trait Test</* comment */ T> {}

Gets reformatted as

trait Test</* comment */ T> /* comment */ T> {}

Whereas no changes were expected.

Playground:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=88c36ba8a83e2c01030bbbf95327be6a

Setting version = Two has no effect.

λ rustfmt --version
rustfmt 1.4.38-stable (7737e0b 2022-04-04)

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentsbugPanic, non-idempotency, invalid code, etc.good first issueIssues up for grabs, also good candidates for new rustfmt contributorshelp wanted

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions