]> git.lizzy.rs Git - rust.git/blob - tests/target/struct_lits_visual_multiline.rs
Honor `#[rustfmt::skip::attributes(derive)]` attribute
[rust.git] / tests / target / struct_lits_visual_multiline.rs
1 // rustfmt-normalize_comments: true
2 // rustfmt-wrap_comments: true
3 // rustfmt-indent_style: Visual
4 // rustfmt-struct_lit_single_line: 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     Fooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { a: foo(),
20                                                                                b: bar() };
21
22     Foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo { // Comment
23                                                                                         a: foo(), /* Comment */
24                                                                                         // Comment
25                                                                                         b: bar() /* Comment */ };
26
27     Foo { a: Bar,
28           b: foo() };
29
30     Quux { x: if cond {
31                bar();
32            },
33            y: baz() };
34
35     A { // Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec a diam lectus. Sed sit
36         // amet ipsum mauris. Maecenas congue ligula ac quam viverra nec consectetur ante
37         // hendrerit. Donec et mollis dolor.
38         first: item(),
39         // Praesent et diam eget libero egestas mattis sit amet vitae augue.
40         // Nam tincidunt congue enim, ut porta lorem lacinia consectetur.
41         second: Item };
42
43     Diagram { //                 o        This graph demonstrates how
44               //                / \       significant whitespace is
45               //               o   o      preserved.
46               //              /|\   \
47               //             o o o   o
48               graph: G }
49 }