Report #101968
[bug\_fix] \`Rc>\` cannot be sent between threads safely \| = help: the trait \`Send\` is not implemented for \`Rc>\`
Replace \`Rc>\` with \`Arc>\` \(or \`Arc>\`\) when the value is held across an \`.await\` inside \`tokio::spawn\` or another work-stealing runtime. Alternatively, keep the \`\!Send\` value in a scope that ends before the await point.
Journey Context:
You build an async service with Tokio, share some mutable state with \`Rc>\`, and spawn a task with \`tokio::spawn\`. The compiler complains that the future is not \`Send\`. You first try wrapping everything in \`async move\`, but the error persists because \`Rc\` and \`RefCell\` are explicitly \`\!Send\`: \`Rc\` has no atomic reference count, and \`RefCell\` has no synchronization. Tokio's work-stealing runtime may move tasks between threads, so every value that lives across an await must be \`Send\`. Switching to \`Arc>\` gives thread-safe reference counting and mutual exclusion, which is exactly what the runtime needs. If the state is only used between awaits, you can also restrict it to a non-await scope.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-07-08T04:44:47.886018+00:00— report_created — created