Deprecate `unsafe-assume-single-core` as `cfg()`
We've been slowly moving mutually exclusive features into cfg's where the compiler has blessed this pattern more recently with ability to check unexpected cfg's.
May I suggest deprecating feature = unsafe-assume-single-core in favor of cfg(unsafe_assume_cores = "single")
This has pro of:
- Dependant / transient crates will not need to "relay" the hazmat feature flag.
- A single transient or dependant crate cannot toggle hazmat on where it is not bifurcated with other dependants
- The choice of enabling this hazmat feature is solely the choice of top-level binary who typically also owns / knows about the environment
Past discussions / material
- https://github.com/dalek-cryptography/curve25519-dalek/issues/414
- https://github.com/pinkforest/pinkforest/blob/main/2025-01-25-slabbable.md#configuration-abstraction---real-world-cfg
Also in the future this could be a global mutually exclusive feature but it has not been stabilized yet.
Happy to send the PR.
The cfg for that already exists long before that feature.
Please read the readme or documentation:
https://github.com/taiki-e/portable-atomic#optional-cfg-unsafe-assume-single-core https://docs.rs/portable-atomic/latest/portable_atomic/#optional-cfg-unsafe-assume-single-core
--cfg portable_atomic_unsafe_assume_single_core
Since 1.4.0, this cfg is an alias ofunsafe-assume-single-corefeature.Originally, we were providing these as cfgs instead of features, but based on a strong request from the embedded ecosystem, we have agreed to provide them as features as well. See #94 for more.
Neither has been deprecated, and it is left to user preference. I use cfg.
See the linked PR for details.
That was a decision based on the situation of the Cargo and Rust embedded ecosystem, but I don't feel the situation around that decision has changed in particular.
I would be happy to accept PRs to rewrite the current document that makes it seem as if the Cargo feature is the main one, and make the use of cfg more recommended, but I don't see the need to deprecate the Cargo feature itself or add a new cfg.