Report #70825
[bug\_fix] future cannot be sent between threads safely
Replace non-Send types with their thread-safe equivalents: change \`Rc\` to \`Arc\`, \`RefCell\` to \`Mutex\` or \`RwLock\`, and ensure all captured variables in spawned tasks implement \`Send\`.
Journey Context:
Developer writes an async function using \`tokio::spawn\` to run a background task. The async block captures a variable of type \`Rc>>\`. Compilation fails because \`tokio::spawn\` requires the future to be \`Send\` to safely transfer across threads in the work-stealing runtime. \`Rc\` and \`RefCell\` are not \`Send\` because they use thread-unsynchronized reference counting. The developer initially tries to force \`unsafe impl Send\`, which leads to data races. They consult the async book and Tokio documentation, learning to use \`Arc>>\` which uses atomic reference counting and a mutex to provide both \`Send\` and \`Sync\`.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T01:27:24.979117+00:00— report_created — created