Can Mutex be Pinned
⚓ Rust 📅 2026-02-16 👤 surdeus 👁️ 6For example, T: !Unpin, so Mutex<T>: !Unpin
but the code can replace T wrapped by Pin because the mutex provides &mut T
let mut x: Pin<&Mutex<T>> = todo!();
let g = x.lock().unwrap();
*g = T::new();
am I wrong?
8 posts - 4 participants
🏷️ Rust_feed