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);
62 .filter(some_mod::some_filter)
86 // params are 1-indexed
88 mparams[match cur.to_digit(10) {
89 Some(d) => d as usize - 1,
90 None => return Err("bad param number".to_owned()),
127 fn is_replaced_content() -> bool {
128 constellat.send(ConstellationMsg::ViewportConstrained(self.id, constraints)).unwrap();
134 std::mem::transmute(dl.symbol::<()>("init").unwrap())
139 let y = expr.kaas()?.test();
140 let loooooooooooooooooooooooooooooooooooooooooong =
141 does_this?.look?.good?.should_we_break?.after_the_first_question_mark?;
142 let yyyy = expr?.another?.another?.another?.another?.another?.another?.another?.another?.test();
143 let zzzz = expr?.another?.another?.another?.another?;
144 let aaa = x??????????????????????????????????????????????????????????????????????????;
147 .loooooooooooooooooooooooooooooooooooooong()
155 parameterized(f, substs, def_id, Ns::Value, &[], |tcx| tcx.lookup_item_type(def_id).generics)?;
156 fooooooooooooooooooooooooooo()?
158 .baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaz()?;
163 ty::ImplOrTraitItem::MethodTraitItem(ref i) => write!(f, "{:?}", i),
164 ty::ImplOrTraitItem::ConstTraitItem(ref i) => write!(f, "{:?}", i),
165 ty::ImplOrTraitItem::TypeTraitItem(ref i) => write!(f, "{:?}", i),
168 ty::tls::with(|tcx| {
169 let tap = ty::Binder(TraitAndProjections(principal, projections));
170 in_binder(f, tcx, &ty::Binder(""), Some(tap))
189 fn save(&self) -> Result<()> {
190 let mut file = File::create(&settings_path)
191 .chain_err(|| ErrorKind::WriteError(settings_path.clone()))?;
201 let x = self.span_from(
202 sub_span.expect("No span found for struct arant variant"),
204 self.sspanpan_from_span(
205 sub_span.expect("No span found for struct variant"),
207 let x = self.spanpan_from_span(
208 sub_span.expect("No span found for struct variant"),
219 pub fn from_ast(diagnostic: &::errors::Handler, attrs: &[ast::Attribute]) -> Attributes {
220 let other_attrs = attrs
223 attr.with_desugared_doc(|attr| {
224 if attr.check_name("doc") {
225 if let Some(mi) = attr.meta() {
226 if let Some(value) = mi.value_str() {
227 doc_strings.push(DocFragment::Include(