Open
Description
Input:
fn hello() {
let _slice = &[
// First item
0x0001,
// Second item
0x0002,
];
two_arg_fn(
// First arg
1,
// Second arg
2,
);
}
fn two_arg_fn(_x: u32, _y: u32) {}
Output:
fn hello() {
let _slice = &[
// First item
0x0001, // Second item
0x0002,
];
two_arg_fn(
// First arg
1, // Second arg
2,
);
}
fn two_arg_fn(_x: u32, _y: u32) {}
Here the intent was to have a comment associated with the element on the following line, but rustfmt confusingly turned the comment for the second element into an end-of-line comment for the first element.
$ rustfmt --version
rustfmt 1.7.0-stable (7cf61ebd 2024-03-27)
Metadata
Metadata
Assignees
Labels
No labels