Skip to content

Argument name comment gets boken if there's another comment before. #3025

@emilio

Description

@emilio

Running rustfmt on the following Rust code:

fn foo() {
    bar(
        one_argument,
        another,
        and_another,
        // One comment explaining something below.
        /* argument_name = */ None,
    )
}

Generates the following diff:

         another,
         and_another,
         // One comment explaining something below.
-        /* argument_name = */ None,
+        /* argument_name = */
+        None,
     )
 }

However removing the single-line comment works as expected, which is inconsistent.

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