]> git.lizzy.rs Git - rust.git/blob - tests/target/nested-visual-block.rs
Tidy up and pass 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) => rewrite_field(
23                     inner_context,
24                     &field,
25                     &Constraints::new(v_budget.checked_sub(1).unwrap_or(0), indent),
26                 ),
27                 StructLitField::Base(ref expr) => {
28                     // 2 = ..
29                     expr.rewrite(
30                         inner_context,
31                         &Constraints::new(try_opt!(v_budget.checked_sub(2)), indent + 2),
32                     ).map(|s| format!("..{}", s))
33                 }
34             }
35         },
36         context.codemap.span_after(span, "{"),
37         span.hi(),
38     );
39
40     // #1580
41     self.0.pool.execute(move || {
42         let _timer = segments.0.rotate_timer.time();
43         if let Err(e) = segments.rotate_async(wal) {
44             error!("error compacting segment storage WAL", unsafe { error: e.display() });
45         }
46     });
47
48     // #1581
49     bootstrap.checks.register("PERSISTED_LOCATIONS", move || {
50         if locations2.0.inner_mut.lock().poisoned {
51             Check::new(
52                 State::Error,
53                 "Persisted location storage is poisoned due to a write failure",
54             )
55         } else {
56             Check::new(State::Healthy, "Persisted location storage is healthy")
57         }
58     });
59 }