X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=tests%2Ftarget%2Fstructs.rs;h=5f471e9a3cdfbf33c7ccddf4b5deeca92363df43;hb=a4cce31ea9d7dfd3213102dee2181ea9a8959279;hp=c525c5878454f2486924b139d57d63be76189e05;hpb=332cc97986e37ec33ef8f21c75be9feb8470b70d;p=rust.git diff --git a/tests/target/structs.rs b/tests/target/structs.rs index c525c587845..5f471e9a3cd 100644 --- a/tests/target/structs.rs +++ b/tests/target/structs.rs @@ -41,7 +41,11 @@ pub struct Writebatch { struct NewType(Type, OtherType); -struct NewInt(pub i32, SomeType /* inline comment */, T /* sup */); +struct NewInt( + pub i32, + SomeType, // inline comment + T, // sup +); struct Qux< 'a, @@ -108,7 +112,10 @@ struct Baz { } // Will this be a one-liner? -struct Tuple(A /* Comment */, B); +struct Tuple( + A, // Comment + B, +); pub struct State time::Timespec> { now: F, @@ -157,10 +164,18 @@ struct Foo( TTTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUU, ); -struct Foo(TTTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTT) +struct Foo( + TTTTTTTTTTTTTTTTTT, + UUUUUUUUUUUUUUUUUUUUUUUU, + TTTTTTTTTTTTTTTTTTT, +) where T: PartialEq; -struct Foo(TTTTTTTTTTTTTTTTT, UUUUUUUUUUUUUUUUUUUUUUUU, TTTTTTTTTTTTTTTTTTTTT) +struct Foo( + TTTTTTTTTTTTTTTTT, + UUUUUUUUUUUUUUUUUUUUUUUU, + TTTTTTTTTTTTTTTTTTTTT, +) where T: PartialEq; struct Foo( @@ -172,7 +187,7 @@ struct Foo( where T: PartialEq; struct Foo( - TTTTTTTTTTTTTTTTT, // Foo + TTTTTTTTTTTTTTTTT, // Foo UUUUUUUUUUUUUUUUUUUUUUUU, // Bar // Baz TTTTTTTTTTTTTTTTTTT, @@ -231,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 +}