]> git.lizzy.rs Git - rust.git/blob - tests/target/nested-visual-block.rs
Reformat tests
[rust.git] / tests / target / nested-visual-block.rs
1 fn main() {
2     // #1078
3     let items = itemize_list(
4         context.codemap,
5         field_iter,
6         "}",
7         |item| match *item {
8             StructLitField::Regular(ref field) => field.span.lo,
9             StructLitField::Base(ref expr) => {
10                 let last_field_hi = fields.last().map_or(span.lo, |field| field.span.hi);
11                 let snippet = context.snippet(mk_sp(last_field_hi, expr.span.lo));
12                 let pos = snippet.find_uncommented("..").unwrap();
13                 last_field_hi + BytePos(pos as u32)
14             }
15         },
16         |item| match *item {
17             StructLitField::Regular(ref field) => field.span.hi,
18             StructLitField::Base(ref expr) => expr.span.hi,
19         },
20         |item| {
21             match *item {
22                 StructLitField::Regular(ref field) => {
23                     rewrite_field(
24                         inner_context,
25                         &field,
26                         &Constraints::new(v_budget.checked_sub(1).unwrap_or(0), indent),
27                     )
28                 }
29                 StructLitField::Base(ref expr) => {
30                     // 2 = ..
31                     expr.rewrite(
32                         inner_context,
33                         &Constraints::new(try_opt!(v_budget.checked_sub(2)), indent + 2),
34                     ).map(|s| format!("..{}", s))
35                 }
36             }
37         },
38         context.codemap.span_after(span, "{"),
39         span.hi,
40     );
41
42     // #1580
43     self.0.pool.execute(move || {
44         let _timer = segments.0.rotate_timer.time();
45         if let Err(e) = segments.rotate_async(wal) {
46             error!("error compacting segment storage WAL", unsafe { error: e.display() });
47         }
48     });
49
50     // #1581
51     bootstrap.checks.register("PERSISTED_LOCATIONS", move || {
52         if locations2.0.inner_mut.lock().poisoned {
53             Check::new(
54                 State::Error,
55                 "Persisted location storage is poisoned due to a write failure",
56             )
57         } else {
58             Check::new(State::Healthy, "Persisted location storage is healthy")
59         }
60     });
61 }