(f: impl FnOnce() -> T + Send + 'static)
| 190 | const DEPTH: usize = 30_000; |
| 191 | |
| 192 | fn on_small_stack<T: Send + 'static>(f: impl FnOnce() -> T + Send + 'static) -> T { |
| 193 | std::thread::Builder::new() |
| 194 | .stack_size(SMALL_STACK) |
| 195 | .spawn(f) |
| 196 | .expect("spawn") |
| 197 | .join() |
| 198 | .expect("walker thread panicked") |
| 199 | } |
| 200 | |
| 201 | fn nested_parens(prefix: &str, suffix: &str) -> String { |
| 202 | format!("{prefix}{}1{}{suffix}", "(".repeat(DEPTH), ")".repeat(DEPTH)) |