Skip to content

Second line of Comment is incorrectly indentated #4546

Open
@davidBar-On

Description

@davidBar-On

Input

fn main() {
    let v = [
        "A", /* item A comment */
        "BBBBBB", /* item BBBBBB comment line 1
                   * item BBBBBB comment line 2 */
        "CCC", /* item CCC comment */
    ];
}

Output

fn main() {
    let v = [
        "A", /* item A comment */
        "BBBBBB", /* item BBBBBB comment line 1
              * item BBBBBB comment line 2 */
        "CCC", /* item CCC comment */
    ];
}

Expected output

Same as input. The second line of the comment to "BBBBBB" is wrongly aligned to the "A" comment. (Based on test case from #4518.)

Meta

  • rustfmt version: rustfmt 2.0.0-rc.2-nightly (30bda450 2020-11-18)
  • From where did you install rustfmt?: self build

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions