I was under the impression that ConstCells primary purpose was to represent the contents of a C T const* to a potentially non-const value. So that, for instance, a Swift implementation of a C function that takes a T* dst, T const* src, size_t len triple can import the parameters as dst: Span<Cell<T>>, src: Span<ConstCell<T>> and merely get tearing instead of undefined behavior if someone mutates src out from under you. Or to protect you from UB if the function in question is akin to memmove and dst and src overlap.
1 Like