uazu / qcell

Statically-checked alternatives to RefCell and RwLock
Apache License 2.0
356 stars 22 forks source link

Features are additive #5

Closed uazu closed 4 years ago

uazu commented 5 years ago

So opt-out features such as no-thread-local are not the correct approach. If one crate depending on qcell opts out, but another one doesn't, it will be forced to opt out anyway as things are at the moment (because cargo builds just one instance of the crate with the sum of all features enabled). This will mean things not working correctly, i.e. probably it will panic immediately on running.

So probably it is best to split out global and thread-local-based TCell as two different types instead of using features.

uazu commented 4 years ago

Resolved in 0.4.0. TLCell is now the thread-local type-based cell, with no need for features.