Open
Description
misformat if two consecutive lines start with /*
and the first line only contains comments and no actual code.
rustfmt doesn't correctly parse the end (*/
) of /*
code blocks. I use a code block to better see the offsets of each field of a type. Unfortunately this causes the second line /*
to be changed to just *
as if it is a continued comment line.
It only happens if the line starts with /*
and has only comments in this line.
.rustfmt.toml:
wrap_comments = true
Input:
pub struct Type {
/* 0x34 */ // _buf2: Buf<0x4>, // padding
/* 0x4C */ pub field: u32,
}
Output:
pub struct Type {
/* 0x34 */ // _buf2: Buf<0x4>, // padding
* 0x4C */ pub field: u32,
}