1 // rustfmt-use_small_heuristics: Off
2 // Test chain formatting.
9 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc
10 .ddddddddddddddddddddddddddd();
12 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddd.eeeeeeee();
14 let f = fooooooooooooooooooooooooooooooooooooooooooooooooooo.baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar;
16 // Test case where first chain element isn't a path, but is shorter than
19 .y(|| match cond() { true => (), false => () });
22 .quux(move || if true {
28 some_fuuuuuuuuunction()
29 .method_call_a(aaaaa, bbbbb, |c| {
34 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
37 }).method_call_b(aaaaa, bbbbb, |c| {
42 fffffffffffffffffffffffffffffffffff(a,
46 *root.borrow_mut() = Some(&script_task);
50 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum = xxxxxxx
53 .fold(0, |acc, x| acc + x);
55 body.fold(Body::new(), |mut body, chunk| {
58 }).and_then(move |body| {
59 let req = Request::from_parts(parts, body);
60 f(req).map_err(|_| io::Error::new(io::ErrorKind::Other, ""))
63 aaaaaaaaaaaaaaaa.map(|x| {
66 }).filter(some_mod::some_filter)
78 }.method_call().method_call();
90 // params are 1-indexed
91 stack.push(mparams[match cur.to_digit(10) {
92 Some(d) => d as usize - 1,
93 None => return Err("bad param number".to_owned()),
100 if cond { some(); } else { none(); }
104 Foo { x: val } .baz(|| { force(); multiline(); }) .quux();
106 Foo { y: i_am_multi_line, z: ok }
108 force(); multiline();
112 a + match x { true => "yay!", false => "boo!" }.bar()
115 fn is_replaced_content() -> bool {
116 constellat.send(ConstellationMsg::ViewportConstrained(
117 self.id, constraints)).unwrap();
123 std::mem::transmute(dl.symbol::<()>("init").unwrap())
128 let y = expr.kaas()?.test();
129 let loooooooooooooooooooooooooooooooooooooooooong = does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
130 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
131 let zzzz = expr?.another?.another?.another?.another?;
132 let aaa = x ???????????? ?????????????? ???? ????? ?????????????? ????????? ?????????????? ??;
134 let y = a.very .loooooooooooooooooooooooooooooooooooooong() .chain()
135 .inside() .weeeeeeeeeeeeeee()? .test() .0
143 |tcx| tcx.lookup_item_type(def_id).generics)?;
144 fooooooooooooooooooooooooooo()?.bar()?.baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
149 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
150 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
151 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
155 ty::tls::with(|tcx| {
156 let tap = ty::Binder(TraitAndProjections(principal, projections));
157 in_binder(f, tcx, &ty::Binder(""), Some(tap))
175 fn save(&self) -> Result<()> {
176 let mut file = File::create(&settings_path).chain_err(|| ErrorKind::WriteError(settings_path.clone()))?;
186 let x = self.span_from(sub_span.expect("No span found for struct arant variant"));
187 self.sspanpan_from_span(sub_span.expect("No span found for struct variant"));
188 let x = self.spanpan_from_span(sub_span.expect("No span found for struct variant"))?;
198 pub fn from_ast(diagnostic: &::errors::Handler,
199 attrs: &[ast::Attribute]) -> Attributes {
200 let other_attrs = attrs.iter().filter_map(|attr| {
201 attr.with_desugared_doc(|attr| {
202 if attr.check_name("doc") {
203 if let Some(mi) = attr.meta() {
204 if let Some(value) = mi.value_str() {
205 doc_strings.push(DocFragment::Include(line,
218 // Avoid orphan in chain
225 Some(value.to_string())
229 .unwrap_or_else(|_: Box<::std::error::Error>| String::from(""));