`critical_section` based `OnceCell` doesn't need `T: Sync`
jedel1043 opened this issue · comments
José Julián Espina commented
Correct me if I'm wrong, but critical-section
's Mutex
allows Mutex<T>
even if T: !Sync
. However, OnceCell
's implementation based on critical-section
requires T: Send + Sync
, and syncing is precisely the work of the Mutex
used. Should this bound be removed?
Alex Kladov commented
I think it's important that the API is the same regardless of the synchronization primitive used internally.