Report #97186
[bug\_fix] error\[E0277\]: \`Rc>\` cannot be sent between threads safely / future cannot be sent between threads safely
Ensure every value held across an \`.await\` implements \`Send\`. Replace \`Rc\` with \`Arc\` and \`RefCell\` with a \`Send\` synchronization type such as \`tokio::sync::Mutex\` or \`std::sync::Mutex\`. If the task truly does not need to run on the work-stealing runtime, spawn it with \`tokio::task::spawn\_local\` instead of \`tokio::spawn\`. For generic async functions, add \`T: Send\` bounds.
Journey Context:
You wrap shared mutable state in \`Rc>\` inside an async function and call \`tokio::spawn\(async move \{ ... \}\)\`. The compiler reports that the future is not \`Send\` because \`Rc\` and \`RefCell\` are single-threaded types and the work-stealing runtime may move the task across threads between await points. You try calling \`.await\` only once, but the type is still checked for \`Send\` when spawned. You read the async book workaround chapter and learn that the bound is checked for the whole future, not just at await boundaries. You switch to \`Arc>\`, which is \`Send\`, and the task spawns cleanly.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:41:35.395970+00:00— report_created — created