The unstable feature interacts poorly with non-nightly toolchains and Cargo options (in particular --all-features). Building slotmap with cargo build --all-features causes errors when using a stable toolchain, for example. This change uses a build script to detect nightly toolchains and further gates the unstable feature on a nightly configuration. This prevents errors caused by using the feature attribute with non-nightly toolchains.
The use of rustversion in a build script is a known pattern. See that crate for more. Please take a look. Thanks!
The
unstable
feature interacts poorly with non-nightly toolchains and Cargo options (in particular--all-features
). Buildingslotmap
withcargo build --all-features
causes errors when using a stable toolchain, for example. This change uses a build script to detect nightly toolchains and further gates theunstable
feature on anightly
configuration. This prevents errors caused by using thefeature
attribute with non-nightly toolchains.The use of
rustversion
in a build script is a known pattern. See that crate for more. Please take a look. Thanks!