Closed nvzqz closed 1 week ago
I would discourage bumping the MSRV past 1.63, as that is the current MSRV for Debian Stable
Compatibility with Debian stable is an explicit non-goal for once_cell:
https://github.com/matklad/once_cell/issues/201#issuecomment-1254883343
I can rewrite this to use an associated type via OncePointee
instead of UnsafeCell<*mut T>
. That should remove the need to bump the MSRV.
@notgull I refactored the code to only require bumping to 1.61.0
.
This is implemented through a new public-in-private
OncePointee
trait. If this was instead done withimpl OnceRef<[T]>
, the compiler fails to infer which methods we want to use.Because of the usage of
core::ptr::slice_from_raw_parts
inconst
, this change increases the MSRV to1.64.0
.To make correctness easier to reason about, I did not use
Ordering::Relaxed
. However, it's likely that this code could be improved by it.