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| {
49 *root.borrow_mut() = Some(&script_task);
53 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
54 xxxxxxx.map(|x| x + 5).map(|x| x / 2).fold(0, |acc, x| acc + x);
61 .filter(some_mod::some_filter)
85 // params are 1-indexed
87 mparams[match cur.to_digit(10) {
88 Some(d) => d as usize - 1,
89 None => return Err("bad param number".to_owned()),
125 fn is_replaced_content() -> bool {
126 constellat.send(ConstellationMsg::ViewportConstrained(self.id, constraints)).unwrap();
132 std::mem::transmute(dl.symbol::<()>("init").unwrap())
137 let y = expr.kaas()?.test();
138 let loooooooooooooooooooooooooooooooooooooooooong =
139 does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
140 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
141 let zzzz = expr?.another?.another?.another?.another?;
142 let aaa = x??????????????????????????????????????????????????????????????????????????;
145 .loooooooooooooooooooooooooooooooooooooong()
153 parameterized(f, substs, def_id, Ns::Value, &[], |tcx| {
154 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))