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| {
42 .method_call_b(aaaaa, bbbbb, |c| {
47 fffffffffffffffffffffffffffffffffff(a, {
48 SCRIPT_TASK_ROOT.with(|root| {
49 *root.borrow_mut() = Some(&script_task);
53 let suuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuum =
54 xxxxxxx.map(|x| x + 5).map(|x| x / 2).fold(0, |acc, x| acc + x);
56 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)
96 // params are 1-indexed
98 mparams[match cur.to_digit(10) {
99 Some(d) => d as usize - 1,
100 None => return Err("bad param number".to_owned()),
142 fn is_replaced_content() -> bool {
143 constellat.send(ConstellationMsg::ViewportConstrained(self.id, constraints)).unwrap();
149 std::mem::transmute(dl.symbol::<()>("init").unwrap())
154 let y = expr.kaas()?.test();
155 let loooooooooooooooooooooooooooooooooooooooooong =
156 does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
157 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
158 let zzzz = expr?.another?.another?.another?.another?;
159 let aaa = x??????????????????????????????????????????????????????????????????????????;
163 .loooooooooooooooooooooooooooooooooooooong()
171 parameterized(f, substs, def_id, Ns::Value, &[], |tcx| tcx.lookup_item_type(def_id).generics)?;
172 fooooooooooooooooooooooooooo()?
174 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
179 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
180 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
181 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
184 ty::tls::with(|tcx| {
185 let tap = ty::Binder(TraitAndProjections(principal, projections));
186 in_binder(f, tcx, &ty::Binder(""), Some(tap))
206 fn save(&self) -> Result<()> {
207 let mut file = File::create(&settings_path)
208 .chain_err(|| ErrorKind::WriteError(settings_path.clone()))?;
219 .span_from(sub_span.expect("No span found for struct arant variant"));
220 self.sspanpan_from_span(
221 sub_span.expect("No span found for struct variant"),
223 let x = self.spanpan_from_span(
224 sub_span.expect("No span found for struct variant"),
235 pub fn from_ast(diagnostic: &::errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
236 let other_attrs = attrs
239 attr.with_desugared_doc(|attr| {
240 if attr.check_name("doc") {
241 if let Some(mi) = attr.meta() {
242 if let Some(value) = mi.value_str() {
243 doc_strings.push(DocFragment::Include(
244 line, attr.span, filename, contents,
256 // Avoid orphan in chain
263 Some(value.to_string())
267 .unwrap_or_else(|_: Box<::std::error::Error>| String::from(""));
304 disallowed_headers.iter().any(|header| *header == name)
305 || disallowed_header_prefixes.iter().any(|prefix| name.starts_with(prefix))