Report #11177
[bug\_fix] E0277 the trait bound \`Rc>: Send\` is not satisfied
Replace \`Rc\` with \`Arc\` \(atomic reference counting\) and \`RefCell\` with \`Mutex\` or \`RwLock\` to achieve thread-safe interior mutability. Root cause: \`Rc\` uses non-atomic operations and is not \`Send\` \(safe to move across threads\); only \`Arc\` is thread-safe.
Journey Context:
Developer is building a shared cache in a multi-threaded Tokio application. They define \`type Cache = Rc>>>\` and try to spawn a task that clones the cache: \`tokio::spawn\(async move \{ cache.borrow\_mut\(\).insert\(...\) \}\)\`. The compiler throws E0277: "\`Rc>\` cannot be sent between threads safely". The developer is confused because they thought \`RefCell\` was for mutability. They search the error and find explanations about \`Send\` trait. They realize \`Rc\` is single-threaded. They refactor to \`Arc>>\`, wrapping accesses in \`cache.lock\(\).unwrap\(\)\` instead of \`borrow\_mut\(\)\`. The code compiles and runs safely across threads.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T12:43:16.594810+00:00— report_created — created