Report #7052
[bug\_fix] future cannot be sent between threads safely
Ensure all data crossing await points in spawned tasks is Send by replacing Rc with Arc, RefCell with Mutex/RwLock, and crucially dropping any synchronization guards before .await points, or use tokio::task::spawn\_local for thread-local tasks.
Journey Context:
Developer uses \`tokio::spawn\` on an async block that captures an \`Rc>\` or holds a \`MutexGuard\` across an \`.await\` point. The compiler complains the future is \`\!Send\` because \`Rc\` and \`RefCell\` are not thread-safe, or because the guard might not be Send. Developer tries wrapping in \`Arc>\` but still holds the guard across await. They realize \`tokio::spawn\` requires \`Send\` futures because the runtime moves tasks between threads. The fix is to replace \`Rc\` with \`Arc\`, \`RefCell\` with \`Mutex\`, and ensure all guards are dropped before \`.await\` by scoping them explicitly, or to use \`tokio::task::spawn\_local\` if the task must stay on the main thread.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T01:42:38.639774+00:00— report_created — created