]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/expr-overflow-delimited.rs
Add 'src/tools/rustfmt/' from commit '7872306edf2e11a69aaffb9434088fd66b46a863'
[rust.git] / src / tools / rustfmt / tests / target / expr-overflow-delimited.rs
1 // rustfmt-overflow_delimited_expr: true
2
3 fn combine_blocklike() {
4     do_thing(|param| {
5         action();
6         foo(param)
7     });
8
9     do_thing(x, |param| {
10         action();
11         foo(param)
12     });
13
14     do_thing(
15         x,
16         // I'll be discussing the `action` with your para(m)legal counsel
17         |param| {
18             action();
19             foo(param)
20         },
21     );
22
23     do_thing(Bar {
24         x: value,
25         y: value2,
26     });
27
28     do_thing(x, Bar {
29         x: value,
30         y: value2,
31     });
32
33     do_thing(
34         x,
35         // Let me tell you about that one time at the `Bar`
36         Bar {
37             x: value,
38             y: value2,
39         },
40     );
41
42     do_thing(&[
43         value_with_longer_name,
44         value2_with_longer_name,
45         value3_with_longer_name,
46         value4_with_longer_name,
47     ]);
48
49     do_thing(x, &[
50         value_with_longer_name,
51         value2_with_longer_name,
52         value3_with_longer_name,
53         value4_with_longer_name,
54     ]);
55
56     do_thing(
57         x,
58         // Just admit it; my list is longer than can be folded on to one line
59         &[
60             value_with_longer_name,
61             value2_with_longer_name,
62             value3_with_longer_name,
63             value4_with_longer_name,
64         ],
65     );
66
67     do_thing(vec![
68         value_with_longer_name,
69         value2_with_longer_name,
70         value3_with_longer_name,
71         value4_with_longer_name,
72     ]);
73
74     do_thing(x, vec![
75         value_with_longer_name,
76         value2_with_longer_name,
77         value3_with_longer_name,
78         value4_with_longer_name,
79     ]);
80
81     do_thing(
82         x,
83         // Just admit it; my list is longer than can be folded on to one line
84         vec![
85             value_with_longer_name,
86             value2_with_longer_name,
87             value3_with_longer_name,
88             value4_with_longer_name,
89         ],
90     );
91
92     do_thing(
93         x,
94         (1, 2, 3, |param| {
95             action();
96             foo(param)
97         }),
98     );
99 }
100
101 fn combine_struct_sample() {
102     let identity = verify(&ctx, VerifyLogin {
103         type_: LoginType::Username,
104         username: args.username.clone(),
105         password: Some(args.password.clone()),
106         domain: None,
107     })?;
108 }
109
110 fn combine_macro_sample() {
111     rocket::ignite()
112         .mount("/", routes![
113             http::auth::login,
114             http::auth::logout,
115             http::cors::options,
116             http::action::dance,
117             http::action::sleep,
118         ])
119         .launch();
120 }