{
  "id": "rust/e0277-send-not-satisfied-for-rc",
  "signature": "error[E0277]: `Rc<RefCell<dyn Trait>>` cannot be sent between threads safely",
  "signature_zh": "错误[E0277]：`Rc<RefCell<dyn Trait>>` 无法在线程间安全发送",
  "regex": "error\\[E0277\\]: `Rc<RefCell<dyn Trait>>` cannot be sent between threads safely",
  "domain": "rust",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Rc is not Send because it uses reference counting without atomic operations; cross-thread use causes data races.",
  "root_cause_type": "generic",
  "root_cause_zh": "Rc 使用非原子引用计数，跨线程使用会导致数据竞争，因此未实现 Send。",
  "versions": [
    {
      "version": "rustc 1.68",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "rustc 1.75",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "rustc 1.82",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Mutex<Arc<RefCell<...>>> adds overhead and doesn't solve the fundamental Rc issue; use Arc instead.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Deriving Clone doesn't change thread safety; the compiler still requires Send on the inner type.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Replace Rc with Arc (atomic reference counting) and use Arc<Mutex<T>> or Arc<RwLock<T>> for interior mutability.",
      "success_rate": 0.9,
      "how": "Replace Rc with Arc (atomic reference counting) and use Arc<Mutex<T>> or Arc<RwLock<T>> for interior mutability.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `std::sync::Mutex<RefCell<dyn Trait>>` or `parking_lot::Mutex` if you must keep Rc, but prefer Arc.",
      "success_rate": 0.75,
      "how": "Use `std::sync::Mutex<RefCell<dyn Trait>>` or `parking_lot::Mutex` if you must keep Rc, but prefer Arc.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "将 Rc 替换为 Arc（原子引用计数），并使用 Arc<Mutex<T>> 或 Arc<RwLock<T>> 实现内部可变性。",
    "使用 `std::sync::Mutex<RefCell<dyn Trait>>` 或 `parking_lot::Mutex` 如果必须保留 Rc，但推荐使用 Arc。"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://doc.rust-lang.org/stable/std/marker/trait.Send.html",
  "official_doc_section": null,
  "error_code": "E0277",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2023-06-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}