Report #4892
[bug\_fix] future cannot be sent between threads safely
Replace non-Send types like Rc> with Arc> or Arc>, ensure all captured variables in async blocks are Send \+ 'static, or use tokio::task::LocalSet for non-Send futures.
Journey Context:
The developer is writing async code with tokio. They create an async block that uses Rc>> to share mutable state. When they try to spawn this future using tokio::spawn, the compiler rejects it with a complex error message stating the future cannot be sent between threads safely because Rc> is not Send. The developer initially tries to add Send bounds to their functions but realizes the underlying type itself is not thread-safe. They search and find that Rc and RefCell are single-threaded reference counting and interior mutability types. They refactor the code to use Arc>> instead. If they were capturing a non-Send receiver, they might need to use tokio::task::LocalSet or ensure the async runtime is single-threaded.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-15T20:15:45.379484+00:00— report_created — created