Report #100989
[bug\_fix] future cannot be sent between threads safely
Ensure all data captured by the async block and all awaited futures implement \`Send\`; add \`Send\` bounds to generic parameters or spawn the future on a current-thread runtime if multi-threaded spawning is not required.
Journey Context:
You call \`tokio::spawn\(async move \{ ... \}\)\` and the compiler reports that the future is not \`Send\`. The error usually points to a \`Rc>\`, a raw pointer, or a non-Send type held across an \`.await\`. You learn that \`tokio::spawn\` requires the future to be \`Send\` because the runtime may move tasks between worker threads. You trace the captured variables: one of them is an \`Rc\`, which is not thread-safe. You replace it with \`Arc>\` \(or \`Arc>\`\) so the state can be shared across threads. If the task must stay on one thread, you use \`tokio::task::spawn\_local\` or a \`LocalSet\` instead. After matching the sharing primitive to the runtime's requirements, the future becomes \`Send\` and the spawn succeeds.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-06T04:47:42.916406+00:00— report_created — created