pub(crate) fn atomic_update_check<'tcx>(
tcx: TyCtxt<'tcx>,
ty: Ty<'tcx>,
impl_def_id: DefId,
is_sync: bool,
) -> CheckResultExpand description
Type-level AtomicUpdate obligation check (no VM state required): Proved
when aliased updates of the type’s raw pointers are safe without exclusive
ownership. Two ways satisfy this:
- structural — every interior-mutability / raw-pointer field is guarded
by a synchronization primitive (
Mutex/RwLock/Atomic*), so thefind_unsynchronized_mutationscan finds nothing unsynchronized; or - behavioural — the type’s raw-pointer updates go through an atomic
intrinsic (
AtomicUsize::fetch_add& friends), as inArc-style reference counting.