{
  "id": "rust/e0277-send-not-satisfied-for-arc-cell",
  "signature": "error[E0277]: `std::cell::Cell<i32>` cannot be shared between threads safely",
  "signature_zh": "错误[E0277]：`std::cell::Cell<i32>` 无法在线程间安全共享",
  "regex": "error\\[E0277\\]: `std::cell::Cell<.*>` cannot be shared between threads safely",
  "domain": "rust",
  "category": "type_error",
  "subcategory": null,
  "root_cause": "Using a non-Send type like Cell inside an Arc or other shared ownership container that is expected to be Send.",
  "root_cause_type": "generic",
  "root_cause_zh": "在期望为 Send 的共享所有权容器（如 Arc）中使用了非 Send 类型（如 Cell）。",
  "versions": [
    {
      "version": "1.70",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.75",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "1.80",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Wrapping Cell in Arc directly without any synchronization",
      "why_fails": "Arc<Cell<T>> is not Send because Cell is !Send. The compiler correctly rejects this.",
      "fail_rate": 0.95,
      "condition": "",
      "sources": []
    },
    {
      "action": "Using Mutex<Cell<T>> but forgetting to implement Send manually",
      "why_fails": "Mutex<Cell<T>> is Send if T: Send, but Cell is !Send, so it still fails. Need to switch to Mutex<T> directly.",
      "fail_rate": 0.7,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Replace Cell with Mutex inside Arc: `Arc<Mutex<i32>>` instead of `Arc<Cell<i32>>`",
      "success_rate": 0.95,
      "how": "Replace Cell with Mutex inside Arc: `Arc<Mutex<i32>>` instead of `Arc<Cell<i32>>`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Use `RwLock` if read-heavy workload: `Arc<RwLock<i32>>`",
      "success_rate": 0.9,
      "how": "Use `RwLock` if read-heavy workload: `Arc<RwLock<i32>>`",
      "condition": "",
      "sources": []
    },
    {
      "action": "For single-threaded context, use `Rc<RefCell<i32>>` instead of Arc",
      "success_rate": 0.8,
      "how": "For single-threaded context, use `Rc<RefCell<i32>>` instead of Arc",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Replace Cell with Mutex inside Arc: `Arc<Mutex<i32>>` instead of `Arc<Cell<i32>>`",
    "Use `RwLock` if read-heavy workload: `Arc<RwLock<i32>>`",
    "For single-threaded context, use `Rc<RefCell<i32>>` instead of Arc"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://doc.rust-lang.org/error-index.html#E0277",
  "official_doc_section": null,
  "error_code": "E0277",
  "verification_tier": "ai_generated",
  "confidence": 0.85,
  "fix_success_rate": 0.85,
  "resolvable": "true",
  "first_seen": "2024-03-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}