( env_path: LeanString<LeanBorrowed<'_>>, quiet: LeanBool<LeanBorrowed<'_>>, fail_out: LeanString<LeanBorrowed<'_>>, )
| 1514 | |
| 1515 | for &result_idx in &result_idxs { |
| 1516 | // Each result slot is written exactly once across the |
| 1517 | // entire run. `build_anon_work` assigns disjoint |
| 1518 | // `result_idxs` per work item; if this assertion fires, |
| 1519 | // that invariant has been broken (likely by a future |
| 1520 | // dedup refactor) and we'd silently drop the second |
| 1521 | // write rather than expose the bug. |
| 1522 | if results[result_idx].set(result.clone()).is_err() { |
| 1523 | debug_assert!( |
| 1524 | false, |
| 1525 | "anon work-item dedup invariant: result slot {result_idx} set twice" |
| 1526 | ); |
| 1527 | } |
| 1528 | if let (Some(log), Err((_, msg))) = |
| 1529 | (failure_log_worker.as_ref(), result.as_ref()) |
| 1530 | { |
| 1531 | let label = format!("#{}", addrs[result_idx].hex()); |
| 1532 | log.record(&label, msg); |
| 1533 | } |
| 1534 | } |
| 1535 | checks_since_clear += 1; |
| 1536 | } |
| 1537 | }) { |
| 1538 | Ok(h) => h, |
| 1539 | Err(e) => { |
| 1540 | progress.stop_reporter(); |
| 1541 | if let Some(r) = reporter.take() { |
| 1542 | let _ = r.join(); |
| 1543 | } |
| 1544 | for h in handles { |
| 1545 | let _ = h.join(); |
| 1546 | } |
| 1547 | return Err(format!("spawn anon worker: {e}")); |
| 1548 | }, |
| 1549 | }; |
| 1550 | handles.push(handle); |
| 1551 | } |
| 1552 | |
| 1553 | let mut panicked = false; |
| 1554 | for h in handles { |
| 1555 | if h.join().is_err() { |
| 1556 | panicked = true; |
| 1557 | } |
| 1558 | } |
| 1559 | progress.stop_reporter(); |
| 1560 | if let Some(r) = reporter { |
| 1561 | let _ = r.join(); |
| 1562 | } |
| 1563 | progress.log_mem_summary(); |
| 1564 | if panicked { |
| 1565 | return Err("anon worker panicked".to_string()); |
| 1566 | } |
| 1567 | |
| 1568 | if let Some(path) = &per_const_out { |
| 1569 | let rows = per_const_rows |
| 1570 | .lock() |
| 1571 | .map_err(|e| format!("per-const entries poisoned: {e}"))?; |
| 1572 | let mut out = String::with_capacity(rows.len() * 96 + 96); |
| 1573 | out.push_str( |
nothing calls this directly
no test coverage detected