This branch adds the ability to access an UnsafeCell by returning a guard that tracks the lifetime of an *mut T or *const T. This allows pointers to UnsafeCells to be stored in data structures, or returned as part of a guard in user code, while still participating in Loom's access tracking.
This branch still needs some tests & docs improvements, but I'm opening it as a draft for now to make sure this is the right approach.
This branch adds the ability to access an
UnsafeCell
by returning a guard that tracks the lifetime of an*mut T
or*const T
. This allows pointers toUnsafeCell
s to be stored in data structures, or returned as part of a guard in user code, while still participating in Loom's access tracking.This branch still needs some tests & docs improvements, but I'm opening it as a draft for now to make sure this is the right approach.