1 // rustfmt-normalize_comments: true
2 // rustfmt-single_line_if_else_max_width: 0
3 // rustfmt-chain_one_line_max: 100
4 // Test chain formatting.
7 let a = b.c.d.1.foo(|x| x + 1);
9 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddd();
12 .ccccccccccccccccccccccccccccccccccccc
13 .ddddddddddddddddddddddddddd
16 let f = fooooooooooooooooooooooooooooooooooooooooooooooooooo
17 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar;
19 // Test case where first chain element isn't a path, but is shorter than
21 x().y(|| match cond() {
26 loong_func().quux(move || if true {
32 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
37 some_fuuuuuuuuunction()
38 .method_call_a(aaaaa, bbbbb, |c| {
42 .method_call_b(aaaaa, bbbbb, |c| {
47 fffffffffffffffffffffffffffffffffff(a, {
48 SCRIPT_TASK_ROOT.with(|root| { *root.borrow_mut() = Some(&script_task); });
51 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
52 xxxxxxx.map(|x| x + 5).map(|x| x / 2).fold(0, |acc, x| acc + x);
59 .filter(some_mod::some_filter)
83 // params are 1-indexed
84 stack.push(mparams[match cur.to_digit(10) {
85 Some(d) => d as usize - 1,
86 None => return Err("bad param number".to_owned()),
122 fn is_replaced_content() -> bool {
123 constellat.send(ConstellationMsg::ViewportConstrained(self.id, constraints)).unwrap();
129 std::mem::transmute(dl.symbol::<()>("init").unwrap())
134 let y = expr.kaas()?.test();
135 let loooooooooooooooooooooooooooooooooooooooooong =
136 does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
137 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
138 let zzzz = expr?.another?.another?.another?.another?;
139 let aaa = x??????????????????????????????????????????????????????????????????????????;
142 .loooooooooooooooooooooooooooooooooooooong()
155 |tcx| tcx.lookup_item_type(def_id).generics)?;
156 fooooooooooooooooooooooooooo()?
158 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
163 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
164 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
165 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
168 ty::tls::with(|tcx| {
169 let tap = ty::Binder(TraitAndProjections(principal, projections));
170 in_binder(f, tcx, &ty::Binder(""), Some(tap))