Scoped Threads

    However, you can use a for this:

    1. fn main() {
    2. thread::scope(|scope| {
    3. scope.spawn(|| {
    4. });
    5. }
    • Normal Rust borrowing rules apply: you can either borrow mutably by one thread, or immutably by any number of threads.