1 // rustfmt-use_small_heuristics: Off
2 // Test chain formatting.
5 let a = b.c.d.1.foo(|x| x + 1);
7 bbbbbbbbbbbbbbbbbbb.ccccccccccccccccccccccccccccccccccccc.ddddddddddddddddddddddddddd();
10 .ccccccccccccccccccccccccccccccccccccc
11 .ddddddddddddddddddddddddddd
14 let f = fooooooooooooooooooooooooooooooooooooooooooooooooooo
15 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaar;
17 // Test case where first chain element isn't a path, but is shorter than
19 x().y(|| match cond() {
24 loong_func().quux(move || {
32 some_fuuuuuuuuunction().method_call_a(aaaaa, bbbbb, |c| {
37 some_fuuuuuuuuunction()
38 .method_call_a(aaaaa, bbbbb, |c| {
41 }).method_call_b(aaaaa, bbbbb, |c| {
46 fffffffffffffffffffffffffffffffffff(a, {
47 SCRIPT_TASK_ROOT.with(|root| {
48 *root.borrow_mut() = Some(&script_task);
52 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
53 xxxxxxx.map(|x| x + 5).map(|x| x / 2).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, ""))
67 }).filter(some_mod::some_filter)
91 // params are 1-indexed
93 mparams[match cur.to_digit(10) {
94 Some(d) => d as usize - 1,
95 None => return Err("bad param number".to_owned()),
130 fn is_replaced_content() -> bool {
131 constellat.send(ConstellationMsg::ViewportConstrained(self.id, constraints)).unwrap();
137 std::mem::transmute(dl.symbol::<()>("init").unwrap())
142 let y = expr.kaas()?.test();
143 let loooooooooooooooooooooooooooooooooooooooooong =
144 does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
145 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
146 let zzzz = expr?.another?.another?.another?.another?;
147 let aaa = x??????????????????????????????????????????????????????????????????????????;
151 .loooooooooooooooooooooooooooooooooooooong()
159 parameterized(f, substs, def_id, Ns::Value, &[], |tcx| tcx.lookup_item_type(def_id).generics)?;
160 fooooooooooooooooooooooooooo()?
162 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
167 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
168 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
169 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
172 ty::tls::with(|tcx| {
173 let tap = ty::Binder(TraitAndProjections(principal, projections));
174 in_binder(f, tcx, &ty::Binder(""), Some(tap))
193 fn save(&self) -> Result<()> {
194 let mut file = File::create(&settings_path)
195 .chain_err(|| ErrorKind::WriteError(settings_path.clone()))?;
206 .span_from(sub_span.expect("No span found for struct arant variant"));
207 self.sspanpan_from_span(
208 sub_span.expect("No span found for struct variant"),
210 let x = self.spanpan_from_span(
211 sub_span.expect("No span found for struct variant"),
222 pub fn from_ast(diagnostic: &::errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
223 let other_attrs = attrs
226 attr.with_desugared_doc(|attr| {
227 if attr.check_name("doc") {
228 if let Some(mi) = attr.meta() {
229 if let Some(value) = mi.value_str() {
230 doc_strings.push(DocFragment::Include(
231 line, attr.span, filename, contents,
242 // Avoid orphan in chain
249 Some(value.to_string())
251 })().unwrap_or_else(|_: Box<::std::error::Error>| String::from(""));