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