]> git.lizzy.rs Git - rust.git/blob - src/tools/rustfmt/tests/target/nested-visual-block.rs
Auto merge of #83342 - Count-Count:win-console-incomplete-utf8, r=m-ou-se
[rust.git] / src / tools / rustfmt / tests / target / nested-visual-block.rs
1 fn main() {
2     // #1078
3     let items = itemize_list(
4         context.source_map,
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                     )
33                     .map(|s| format!("..{}", s))
34                 }
35             }
36         },
37         context.source_map.span_after(span, "{"),
38         span.hi(),
39     );
40
41     // #1580
42     self.0.pool.execute(move || {
43         let _timer = segments.0.rotate_timer.time();
44         if let Err(e) = segments.rotate_async(wal) {
45             error!("error compacting segment storage WAL", unsafe { error: e.display() });
46         }
47     });
48
49     // #1581
50     bootstrap.checks.register("PERSISTED_LOCATIONS", move || {
51         if locations2.0.inner_mut.lock().poisoned {
52             Check::new(
53                 State::Error,
54                 "Persisted location storage is poisoned due to a write failure",
55             )
56         } else {
57             Check::new(State::Healthy, "Persisted location storage is healthy")
58         }
59     });
60 }