Skip to content

format_code_in_doc_comments formats some long line comments to block comments #5533

Closed
@pan93412

Description

@pan93412

Meta

Description

After enabling format_code_in_doc_comments, rustfmt formats the following line comments to block comments – which is neither a documented nor an expected behavior.

struct TestStruct {
    position_currency: String, // Currency for position of this contract. If not null, 1 contract = 1 positionCurrency.
    pu: Option<i64>, // Previous event update sequense ("u" of previous message), -1 also means None
}

Expectation

rustfmt should not touch this.

struct TestStruct {
    position_currency: String, // Currency for position of this contract. If not null, 1 contract = 1 positionCurrency.
    pu: Option<i64>, // Previous event update sequense ("u" of previous message), -1 also means None
}

Actual Result

struct TestStruct {
    position_currency: String, /* Currency for position of this contract. If not null, 1 contract = 1 positionCurrency. */
    pu: Option<i64>, /* Previous event update sequense ("u" of previous message), -1 also means None */
}

Screenshot

rustfmt with format_code_in_doc_comments changes the long comments to block comments

Related

#3348

Metadata

Metadata

Assignees

No one assigned

    Labels

    a-commentsgood first issueIssues up for grabs, also good candidates for new rustfmt contributorsonly-with-optionrequires a non-default option value to reproduce

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions