(
depth: usize,
rng: &mut XorShift64Star,
)
| 1375 | }); |
| 1376 | assert_eq!(value, 42); |
| 1377 | |
| 1378 | THREAD_POOL.depopulate(); |
| 1379 | } |
| 1380 | |
| 1381 | /// This is a handy future that needs to be polled repeatedly before |
| 1382 | /// resolving. |
| 1383 | /// |
| 1384 | /// Each time it is polled, it wakes itself (so it will be polled again) and |
| 1385 | /// yields. It does this until it has been polled 128 times. |
| 1386 | /// |
| 1387 | /// This lets us test the behavior of scopes for sleeping tasks, to ensure |
| 1388 | /// we do not return from the scope while tasks are still pending. |
| 1389 | #[derive(Default)] |
| 1390 | struct CountFuture { |
| 1391 | /// The number of times the future has been polled. |
| 1392 | count: usize, |
| 1393 | } |
| 1394 | |
| 1395 | impl Future for CountFuture { |
| 1396 | type Output = (); |
no test coverage detected