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