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 aaaaaaaaaaaaaaaa.map(|x| {
59 }).filter(some_mod::some_filter)
71 }.method_call().method_call();
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()),
93 if cond { some(); } else { none(); }
97 Foo { x: val } .baz(|| { force(); multiline(); }) .quux();
99 Foo { y: i_am_multi_line, z: ok }
101 force(); multiline();
105 a + match x { true => "yay!", false => "boo!" }.bar()
108 fn is_replaced_content() -> bool {
109 constellat.send(ConstellationMsg::ViewportConstrained(
110 self.id, constraints)).unwrap();
116 std::mem::transmute(dl.symbol::<()>("init").unwrap())
121 let y = expr.kaas()?.test();
122 let loooooooooooooooooooooooooooooooooooooooooong = does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
123 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
124 let zzzz = expr?.another?.another?.another?.another?;
125 let aaa = x ???????????? ?????????????? ???? ????? ?????????????? ????????? ?????????????? ??;
127 let y = a.very .loooooooooooooooooooooooooooooooooooooong() .chain()
128 .inside() .weeeeeeeeeeeeeee()? .test() .0
136 |tcx| tcx.lookup_item_type(def_id).generics)?;
137 fooooooooooooooooooooooooooo()?.bar()?.baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
142 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
143 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
144 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
148 ty::tls::with(|tcx| {
149 let tap = ty::Binder(TraitAndProjections(principal, projections));
150 in_binder(f, tcx, &ty::Binder(""), Some(tap))
168 fn save(&self) -> Result<()> {
169 let mut file = File::create(&settings_path).chain_err(|| ErrorKind::WriteError(settings_path.clone()))?;
179 let x = self.span_from(sub_span.expect("No span found for struct arant variant"));
180 self.sspanpan_from_span(sub_span.expect("No span found for struct variant"));
181 let x = self.spanpan_from_span(sub_span.expect("No span found for struct variant"))?;
191 pub fn from_ast(diagnostic: &::errors::Handler,
192 attrs: &[ast::Attribute]) -> Attributes {
193 let other_attrs = attrs.iter().filter_map(|attr| {
194 attr.with_desugared_doc(|attr| {
195 if attr.check_name("doc") {
196 if let Some(mi) = attr.meta() {
197 if let Some(value) = mi.value_str() {
198 doc_strings.push(DocFragment::Include(line,