Report #22518
[bug\_fix] E0277: the trait bound \`std::rc::Rc<...>: std::marker::Send\` is not satisfied
Replace \`Rc\` with \`Arc\` \(Atomically Reference Counted\) for shared ownership across threads, and replace \`RefCell\` with \`Mutex\` or \`RwLock\` for interior mutability across threads. The root cause is that \`Rc\` uses non-atomic reference counting that is not thread-safe, while \`Arc\` uses atomic operations. Rust's type system prevents sending non-Send types across thread boundaries to prevent data races.
Journey Context:
Developer creates a struct holding an \`Rc>\` or just \`Rc\`, then attempts to spawn a thread using \`thread::spawn\` or send the data through a channel \(\`tx.send\(data\)\`\). The compiler emits E0277, noting that \`Rc<...>\` does not implement \`Send\`. Developer initially tries to unsafe impl Send, which is unsound because Rc truly isn't thread-safe. They search for 'rust share ownership between threads' and discover \`Arc\`. They replace \`Rc::new\(...\)\` with \`Arc::new\(...\)\`. If they also used \`RefCell\`, they realize they need \`Mutex\` or \`RwLock\` for interior mutability across threads, not just \`Arc\`. The build succeeds after these replacements.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-17T16:12:11.468625+00:00— report_created — created