# error[E0277]: the trait bound `RefCell<i32>: std::marker::Sync` is not satisfied

- **ID:** `rust/e0277-the-trait-bound-stdmarkersync-is-not-satisfied`
- **Domain:** rust
- **Category:** type_error
- **Error Code:** `E0277`
- **Verification:** ai_generated
- **Fix Rate:** 90%

## Root Cause

RefCell provides interior mutability but is not Sync, so it cannot be shared across threads via Arc or static variables.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| rustc 1.68.0 | active | — | — |
| rustc 1.70.0 | active | — | — |
| rustc 1.75.0 | active | — | — |

## Workarounds

1. **Replace RefCell with Mutex: `let shared = Arc::new(Mutex::new(42));` then lock with `shared.lock().unwrap()`. Mutex is Sync and allows interior mutability safely across threads.** (95% success)
   ```
   Replace RefCell with Mutex: `let shared = Arc::new(Mutex::new(42));` then lock with `shared.lock().unwrap()`. Mutex is Sync and allows interior mutability safely across threads.
   ```
2. **Use atomic types for simple integers: `use std::sync::atomic::{AtomicI32, Ordering}; let shared = Arc::new(AtomicI32::new(42)); shared.store(100, Ordering::SeqCst);`** (90% success)
   ```
   Use atomic types for simple integers: `use std::sync::atomic::{AtomicI32, Ordering}; let shared = Arc::new(AtomicI32::new(42)); shared.store(100, Ordering::SeqCst);`
   ```
3. **If only single-threaded access is needed, use `Rc<RefCell<i32>>` instead of `Arc<RefCell<i32>>`.** (85% success)
   ```
   If only single-threaded access is needed, use `Rc<RefCell<i32>>` instead of `Arc<RefCell<i32>>`.
   ```

## Dead Ends

- **** — Sync is a trait for safe shared access across threads, not related to cloning. Deriving Clone only enables cloning, not thread safety. (95% fail)
- **** — Arc provides shared ownership but does not make the inner type Sync. Mutex already provides Sync, so wrapping RefCell inside Mutex is unnecessary and the outer Arc doesn't help. (80% fail)
- **** — Marking RefCell as Sync is unsound because it allows data races. The compiler correctly prevents this. (70% fail)
