]> git.lizzy.rs Git - rust.git/blobdiff - tests/target/structs.rs
Update tests
[rust.git] / tests / target / structs.rs
index 541abd36c7c2c77797259ff1b21caabf3bb4c8a0..5f471e9a3cdfbf33c7ccddf4b5deeca92363df43 100644 (file)
@@ -41,14 +41,19 @@ pub struct Writebatch<K: Key> {
 
 struct NewType(Type, OtherType);
 
-struct NewInt<T: Copy>(pub i32, SomeType /* inline comment */, T /* sup */);
-
-struct Qux<'a,
-           N: Clone + 'a,
-           E: Clone + 'a,
-           G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
-           W: Write + Copy>
-(
+struct NewInt<T: Copy>(
+    pub i32,
+    SomeType, // inline comment
+    T,        // sup
+);
+
+struct Qux<
+    'a,
+    N: Clone + 'a,
+    E: Clone + 'a,
+    G: Labeller<'a, N, E> + GraphWalk<'a, N, E>,
+    W: Write + Copy,
+>(
     AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA, // Comment
     BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
     #[AnAttr]
@@ -62,7 +67,7 @@ struct Tuple(
     // Comment 1
     AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA,
     // Comment 2
-    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB
+    BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB,
 );
 
 // With a where clause and generics.
@@ -107,7 +112,10 @@ struct Baz {
 }
 
 // Will this be a one-liner?
-struct Tuple(A /* Comment */, B);
+struct Tuple(
+    A, // Comment
+    B,
+);
 
 pub struct State<F: FnMut() -> time::Timespec> {
     now: F,
@@ -154,29 +162,37 @@ struct Foo<T>(
     TTTTTTTTTTTTTTTTT,
     UUUUUUUUUUUUUUUUUUUUUUUU,
     TTTTTTTTTTTTTTTTTTT,
-    UUUUUUUUUUUUUUUUUUU
+    UUUUUUUUUUUUUUUUUUU,
 );
-struct Foo<T>(TTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT)
+struct Foo<T>(
+    TTTTTTTTTTTTTTTTTT,
+    UUUUUUUUUUUUUUUUUUUUUUUU,
+    TTTTTTTTTTTTTTTTTTT,
+)
 where
     T: PartialEq;
-struct Foo<T>(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTTTT)
+struct Foo<T>(
+    TTTTTTTTTTTTTTTTT,
+    UUUUUUUUUUUUUUUUUUUUUUUU,
+    TTTTTTTTTTTTTTTTTTTTT,
+)
 where
     T: PartialEq;
 struct Foo<T>(
     TTTTTTTTTTTTTTTTT,
     UUUUUUUUUUUUUUUUUUUUUUUU,
     TTTTTTTTTTTTTTTTTTT,
-    UUUUUUUUUUUUUUUUUUU
+    UUUUUUUUUUUUUUUUUUU,
 )
 where
     T: PartialEq;
 struct Foo<T>(
-    TTTTTTTTTTTTTTTTT, // Foo
+    TTTTTTTTTTTTTTTTT,        // Foo
     UUUUUUUUUUUUUUUUUUUUUUUU, // Bar
     // Baz
     TTTTTTTTTTTTTTTTTTT,
     // Qux (FIXME #572 - doc comment)
-    UUUUUUUUUUUUUUUUUUU
+    UUUUUUUUUUUUUUUUUUU,
 );
 
 mod m {
@@ -191,7 +207,7 @@ struct X<T>
 struct Foo<T>(
     TTTTTTTTTTTTTTTTTTT,
     /// Qux
-    UUUUUUUUUUUUUUUUUUU
+    UUUUUUUUUUUUUUUUUUU,
 );
 
 struct Issue677 {
@@ -230,3 +246,26 @@ fn foo() {
     convex_shape.set_point(2, &Vector2f { x: 450.0, y: 100.0 });
     convex_shape.set_point(3, &Vector2f { x: 580.0, y: 150.0 });
 }
+
+struct Foo {
+    aaaaa: u32, // a
+
+    b: u32,  // b
+    cc: u32, // cc
+
+    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx: u32, // 1
+    yy: u32,  // comment2
+    zzz: u32, // comment3
+
+    aaaaaa: u32, // comment4
+    bb: u32,     // comment5
+    // separate
+    dd: u32, // comment7
+    c: u32,  // comment6
+
+    aaaaaaa: u32, /* multi
+                   * line
+                   * comment
+                   * */
+    b: u32, // hi
+}