about summary refs log tree commit diff
path: root/tests/source/structs.rs
diff options
context:
space:
mode:
authormwiczer <wiczerm@gmail.com>2015-10-07 19:23:07 -0400
committermwiczer <wiczerm@gmail.com>2015-10-08 17:22:57 -0400
commit5162282b6060349a672419fb86cdb2a46b59d113 (patch)
treead21dc82debc3ffddad10f3b790a9c49a2f1d539 /tests/source/structs.rs
parent8880c0e5d3963c2ec75e22e70421d7185e746c7c (diff)
Support pre- and post-comments for enums
Use lists to format enum variants rather than special formatting.
Add tests for enums mostly around block comments.
Diffstat (limited to 'tests/source/structs.rs')
-rw-r--r--tests/source/structs.rs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/source/structs.rs b/tests/source/structs.rs
index bd9db77fec0..26578bf8c23 100644
--- a/tests/source/structs.rs
+++ b/tests/source/structs.rs
@@ -105,3 +105,13 @@ pub struct State<F: FnMut()> { now: F }
 
 struct Palette { /// A map of indizes in the palette to a count of pixels in approximately that color
                     foo: i32}
+
+// Splitting a single line comment into a block previously had a misalignment
+// when the field had attributes
+struct FieldsWithAttributes {
+    // Pre Comment
+    #[rustfmt_skip] pub host:String, // Post comment BBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBB BBBBBBBBBBBBBBBBB BBBBBBBBBBB
+    //Another pre comment
+    #[attr1]
+    #[attr2] pub id: usize // CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCC CCCCCCCCCCCCCCCCCC CCCCCCCCCCCCCC CCCCCCCCCCCC
+}