1 // rustfmt-normalize_comments: true
2 // rustfmt-use_small_heuristics: false
3 // Test chain formatting.
10 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
11 .ddddddddddddddddddddddddddd();
13 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddd.eeeeeeee();
15 let f = fooooooooooooooooooooooooooooooooooooooooooooooooooo.baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar;
17 // Test case where first chain element isn't a path, but is shorter than
20 .y(|| match cond() { true => (), false => () });
23 .quux(move || if true {
29 some_fuuuuuuuuunction()
30 .method_call_a(aaaaa, bbbbb, |c| {
35 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
38 }).method_call_b(aaaaa, bbbbb, |c| {
43 fffffffffffffffffffffffffffffffffff(a,
47 *root.borrow_mut() = Some(&script_task);
51 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum = xxxxxxx
54 .fold(0, |acc, x| acc + x);
56 body.fold(Body::new(), |mut body, chunk| {
59 }).and_then(move |body| {
60 let req = Request::from_parts(parts, body);
61 f(req).map_err(|_| io::Error::new(io::ErrorKind::Other, ""))
64 aaaaaaaaaaaaaaaa.map(|x| {
67 }).filter(some_mod::some_filter)
79 }.method_call().method_call();
91 // params are 1-indexed
92 stack.push(mparams[match cur.to_digit(10) {
93 Some(d) => d as usize - 1,
94 None => return Err("bad param number".to_owned()),
101 if cond { some(); } else { none(); }
105 Foo { x: val } .baz(|| { force(); multiline(); }) .quux();
107 Foo { y: i_am_multi_line, z: ok }
109 force(); multiline();
113 a + match x { true => "yay!", false => "boo!" }.bar()
116 fn is_replaced_content() -> bool {
117 constellat.send(ConstellationMsg::ViewportConstrained(
118 self.id, constraints)).unwrap();
124 std::mem::transmute(dl.symbol::<()>("init").unwrap())
129 let y = expr.kaas()?.test();
130 let loooooooooooooooooooooooooooooooooooooooooong = does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
131 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
132 let zzzz = expr?.another?.another?.another?.another?;
133 let aaa = x ???????????? ?????????????? ???? ????? ?????????????? ????????? ?????????????? ??;
135 let y = a.very .loooooooooooooooooooooooooooooooooooooong() .chain()
136 .inside() .weeeeeeeeeeeeeee()? .test() .0
144 |tcx| tcx.lookup_item_type(def_id).generics)?;
145 fooooooooooooooooooooooooooo()?.bar()?.baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
150 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
151 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
152 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
156 ty::tls::with(|tcx| {
157 let tap = ty::Binder(TraitAndProjections(principal, projections));
158 in_binder(f, tcx, &ty::Binder(""), Some(tap))
176 fn save(&self) -> Result<()> {
177 let mut file = File::create(&settings_path).chain_err(|| ErrorKind::WriteError(settings_path.clone()))?;
187 let x = self.span_from(sub_span.expect("No span found for struct arant variant"));
188 self.sspanpan_from_span(sub_span.expect("No span found for struct variant"));
189 let x = self.spanpan_from_span(sub_span.expect("No span found for struct variant"))?;
199 pub fn from_ast(diagnostic: &::errors::Handler,
200 attrs: &[ast::Attribute]) -> Attributes {
201 let other_attrs = attrs.iter().filter_map(|attr| {
202 attr.with_desugared_doc(|attr| {
203 if attr.check_name("doc") {
204 if let Some(mi) = attr.meta() {
205 if let Some(value) = mi.value_str() {
206 doc_strings.push(DocFragment::Include(line,