]> git.lizzy.rs Git - rust.git/blob - tests/source/struct_lits_visual.rs
Remove unnecessary use of Box in `format_function_type`
[rust.git] / tests / source / 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*/, /* comment*/ b: bar(), ..something };
15
16     Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: f(), b: b(), };
17
18     Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo {
19         // Comment
20         a: foo(), // Comment
21         // Comment
22         b: bar(), // Comment
23     };
24
25     Foo { a:Bar,
26           b:f() };
27
28     Quux { x: if cond { bar(); }, y: baz() };
29
30     Baz { x: yxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, z: zzzzz // test
31     };
32
33     A { 
34     // 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.
35     first: item(),
36         // Praesent et diam eget libero egestas mattis sit amet vitae augue.
37         // Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
38         second: Item
39     };
40
41     Diagram { /*                 o        This graph demonstrates how                  
42                *                / \       significant whitespace is           
43                *               o   o      preserved.  
44                *              /|\   \
45                *             o o o   o */
46               graph: G, }
47 }