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 // Test case where first chain element isn't a path, but is shorter than
18 x().y(|| match cond() {
23 loong_func().quux(move || if true {
29 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
34 some_fuuuuuuuuunction()
35 .method_call_a(aaaaa, bbbbb, |c| {
39 .method_call_b(aaaaa, bbbbb, |c| {
44 fffffffffffffffffffffffffffffffffff(a, {
45 SCRIPT_TASK_ROOT.with(|root| { *root.borrow_mut() = Some(&script_task); });
48 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
49 xxxxxxx.map(|x| x + 5).map(|x| x / 2).fold(0, |acc, x| acc + x);
56 .filter(some_mod::some_filter)
82 // params are 1-indexed
83 stack.push(mparams[match cur.to_digit(10) {
84 Some(d) => d as usize - 1,
85 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()
158 |tcx| tcx.lookup_item_type(def_id).generics)?;
159 fooooooooooooooooooooooooooo()?
161 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
166 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
167 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
168 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
171 ty::tls::with(|tcx| {
172 let tap = ty::Binder(TraitAndProjections(principal, projections));
173 in_binder(f, tcx, &ty::Binder(""), Some(tap))