rust/tests/source/issue_4854.rs
Szymon Gibała b4a4bf0bf8
Fix formatting of comments in empty structs (#5171)
* Fix formatting of comments in empty structs

* Add tests

* Add single line tests

* Fix block comments

* Revert changes of test source files
2022-01-28 22:55:47 -06:00

114 lines
1.2 KiB
Rust

struct Struct {
// Multiline comment
// should be formatted
// properly.
}
struct Struct2 {
// This formatting
// Should be changed
}
struct Struct3(
// This
// is
// correct
);
struct Struct4(
// This
// is
// not
// correct
);
struct Struct5 {
/*
Comment block
with many lines.
*/
}
struct Struct6(
/*
Comment block
with many lines.
*/
);
struct Struct7 {
/*
Invalid
format
*/
}
struct Struct8(
/*
Invalid
format
*/
);
struct Struct9 { /* bar */ }
struct Struct10 { /* bar
baz
*/ }
mod module {
struct Struct {
// Multiline comment
// should be formatted
// properly.
}
struct Struct2 {
// This formatting
// Should be changed
}
struct Struct3(
// This
// is
// correct
);
struct Struct4(
// This
// is
// not
// correct
);
struct Struct5 {
/*
Comment block
with many lines.
*/
}
struct Struct6(
/*
Comment block
with many lines.
*/
);
struct Struct7 {
/*
Invalid
format
*/
}
struct Struct8(
/*
Invalid
format
*/
);
struct Struct9 { /* bar */ }
}