Can you specify a non-static lifetime for threads? [duplicate]
问题 This question already has answers here : How can I pass a reference to a stack variable to a thread? (1 answer) Thread references require static lifetime? (1 answer) How do I use static lifetimes with threads? (2 answers) How can I send non-static data to a thread in Rust and is it needed in this example? (1 answer) Closed 1 year ago . Here's a toy example of my problem: use std::sync::{Arc, Mutex}; fn operate_in_chunks(vec: &mut Vec<f32>) { let chunk_size = 10; let mutex_vec: Arc<Mutex<&mut