1 // rustfmt-array_layout: Block
2 // rustfmt-fn_call_style: Block
3 // rustfmt-control_style: Rfc
4 // Test expressions with block formatting.
10 let foo = [a_long_name, a_very_lng_name, a_long_name];
83 let y = [/* comment */ 1, 2 /* post comment */, 3];
87 test123: value_one_two_three_four,
93 let a = WeightedChoice::new(&mut [
94 Weighted { weight: x, item: 0 },
95 Weighted { weight: 1, item: 1 },
96 Weighted { weight: x, item: 2 },
97 Weighted { weight: 1, item: 3 },
101 xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx,
102 yyyyyyyyyyyyyyyyyyyyyyyyyyy,
107 [1 + 3, 4, 5, 6, 7, 7, fncall::<Vec<_>>(3 - 1)]
110 fn function_calls() {
111 let items = itemize_list(
115 |item| item.span.lo(),
116 |item| item.span.hi(),
121 width: remaining_width,
134 |item| item.span.lo(),
135 |item| item.span.hi(),
140 width: remaining_width,
167 baz!(one_item_macro_which_is_also_loooooooooooooooooooooooooooooooooooooooooooooooong);
169 let _ = match option {
179 Some(p) => baz!(one_item_macro_as_expression_which_is_also_loooooooooooooooong),
185 .compare_exchandsfasdsdfgsdgsdfgsdfgsdfgsdfgsdfgfsfdsage_weak(
200 if real_total <= limit && !pre_line_comments
201 && !items.into_iter().any(|item| item.as_ref().is_multiline())
203 DefinitiveListTactic::Horizontal
234 let opt = Some(Struct(
245 do_thing(x, |param| {
259 lllllllllong_argument_one,
260 lllllllllong_argument_two,
261 lllllllllllllllllllllllllllllong_argument_three,
268 pparam1param1param1param1param1param1param1param1param1param1aram1,
282 Some(x) => somefunc(anotherfunc(
292 Some(x) => (1, 2, |x| {
297 Some(x) => SomeStruct {
298 f1: long_argument_one,
299 f2: long_argument_two,
300 f3: long_argument_three,
302 None => Ok(SomeStruct {
303 f1: long_argument_one,
304 f2: long_argument_two,
305 f3: long_argument_three,
310 y => func(xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx),
313 yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
324 /* This comment waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay too long to be kept on the same line */
327 this_last_arg_is_tooooooooooooooooooooooooooooooooo_long_to_be_kept_with_the_pre_comment,
332 let channel: &str = seq.next_element()?
333 .ok_or_else(|| de::Error::invalid_length(2, &self))?;