Skip to content

A comment is removed after pub keyword in a struct. #2781

Closed
@LunaBorowska

Description

@LunaBorowska

After reading http://journal.stuffwithstuff.com/2015/09/08/the-hardest-program-ive-ever-written/, I decided to put one of code examples provided here in Rust.

pub // Oh, crap. A line comment.
struct Foo {}

The original code used abstract, but there is no such keyword in Rust, I used pub instead. Rustfmt seeing that removed a comment. This is an edge case, I don't care what it formats down to, but I think comment should be preserved.

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentsbugPanic, 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