1 // rustfmt-normalize_comments: true
2 // rustfmt-use_small_heuristics: false
3 // Test chain formatting.
6 let a = b.c.d.1.foo(|x| x + 1);
8 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddd();
11 .ccccccccccccccccccccccccccccccccccccc
12 .ddddddddddddddddddddddddddd
15 let f = fooooooooooooooooooooooooooooooooooooooooooooooooooo
16 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar;
18 // Test case where first chain element isn't a path, but is shorter than
20 x().y(|| match cond() {
25 loong_func().quux(move || {
33 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
38 some_fuuuuuuuuunction()
39 .method_call_a(aaaaa, bbbbb, |c| {
43 .method_call_b(aaaaa, bbbbb, |c| {
48 fffffffffffffffffffffffffffffffffff(a, {
49 SCRIPT_TASK_ROOT.with(|root| {
50 *root.borrow_mut() = Some(&script_task);
54 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
55 xxxxxxx.map(|x| x + 5).map(|x| x / 2).fold(0, |acc, x| acc + x);
57 body.fold(Body::new(), |mut body, chunk| {
60 }).and_then(move |body| {
61 let req = Request::from_parts(parts, body);
62 f(req).map_err(|_| io::Error::new(io::ErrorKind::Other, ""))
70 .filter(some_mod::some_filter)
94 // params are 1-indexed
96 mparams[match cur.to_digit(10) {
97 Some(d) => d as usize - 1,
98 None => return Err("bad param number".to_owned()),
135 fn is_replaced_content() -> bool {
136 constellat.send(ConstellationMsg::ViewportConstrained(self.id, constraints)).unwrap();
142 std::mem::transmute(dl.symbol::<()>("init").unwrap())
147 let y = expr.kaas()?.test();
148 let loooooooooooooooooooooooooooooooooooooooooong =
149 does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
150 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
151 let zzzz = expr?.another?.another?.another?.another?;
152 let aaa = x??????????????????????????????????????????????????????????????????????????;
155 .loooooooooooooooooooooooooooooooooooooong()
163 parameterized(f, substs, def_id, Ns::Value, &[], |tcx| tcx.lookup_item_type(def_id).generics)?;
164 fooooooooooooooooooooooooooo()?
166 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
171 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
172 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
173 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
176 ty::tls::with(|tcx| {
177 let tap = ty::Binder(TraitAndProjections(principal, projections));
178 in_binder(f, tcx, &ty::Binder(""), Some(tap))
197 fn save(&self) -> Result<()> {
198 let mut file = File::create(&settings_path)
199 .chain_err(|| ErrorKind::WriteError(settings_path.clone()))?;
209 let x = self.span_from(
210 sub_span.expect("No span found for struct arant variant"),
212 self.sspanpan_from_span(
213 sub_span.expect("No span found for struct variant"),
215 let x = self.spanpan_from_span(
216 sub_span.expect("No span found for struct variant"),
227 pub fn from_ast(diagnostic: &::errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
228 let other_attrs = attrs
231 attr.with_desugared_doc(|attr| {
232 if attr.check_name("doc") {
233 if let Some(mi) = attr.meta() {
234 if let Some(value) = mi.value_str() {
235 doc_strings.push(DocFragment::Include(
251 // Avoid orphan in chain
258 Some(value.to_string())
260 })().unwrap_or_else(|_: Box<::std::error::Error>| String::from(""));