move closure
A closure marked move, which takes ownership of every variable it uses.
A move closure captures every variable it uses by value (copying Copy types), so it can outlive the scope where it was created.
Examples
thread::spawn(|| println!("{name}"))fails with E0373 because the closure only borrowsname;thread::spawn(move || println!("{name}"))compiles.
See also