]> git.lizzy.rs Git - rust.git/blob - tests/target/struct_lits_visual.rs
Tidy up and pass tests
[rust.git] / tests / target / struct_lits_visual.rs
1 // rustfmt-normalize_comments: true
2 // rustfmt-wrap_comments: true
3 // rustfmt-indent_style: Visual
4 // rustfmt-error_on_line_overflow: false
5
6 // Struct literal expressions.
7
8 fn main() {
9     let x = Bar;
10
11     // Comment
12     let y = Foo { a: x };
13
14     Foo { a: foo(), // comment
15           // comment
16           b: bar(),
17           ..something };
18
19     Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b() };
20
21     Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { // Comment
22                                                                                         a: foo(), /* Comment */
23                                                                                         // Comment
24                                                                                         b: bar(), /* Comment */ };
25
26     Foo { a: Bar, b: f() };
27
28     Quux { x: if cond {
29                bar();
30            },
31            y: baz(), };
32
33     Baz { x: yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
34           z: zzzzz, /* test */ };
35
36     A { // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
37         // amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
38         // hendrerit. Donec et mollis dolor.
39         first: item(),
40         // Praesent et diam eget libero egestas mattis sit amet vitae augue.
41         // Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
42         second: Item, };
43
44     Diagram { //                 o        This graph demonstrates how
45               //                / \       significant whitespace is
46               //               o   o      preserved.
47               //              /|\   \
48               //             o o o   o
49               graph: G, }
50 }