hashes: Do not enable core2/alloc feature

`core2` is for Read/Write, nothing to do with allocation and we do not
use the "alloc" feature of `core2` in `hashes`.

Fix core2 dependency/features by doing:

- Explicitly enable "bitcoin_hashes/core2" in `bitcoin`.
- Do not enable "core2/alloc" in `hashes`
This commit is contained in:
Tobin C. Harding 2023-02-03 10:03:37 +11:00
parent c15f8dee29
commit aa62ca224a
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
2 changed files with 2 additions and 3 deletions

View File

@ -28,7 +28,7 @@ bitcoinconsensus-std = ["bitcoinconsensus/std", "std"]
# Instead no-std enables additional features required for this crate to be usable without std. # Instead no-std enables additional features required for this crate to be usable without std.
# As a result, both can be enabled without conflict. # As a result, both can be enabled without conflict.
std = ["secp256k1/std", "bitcoin_hashes/std", "bech32/std", "bitcoin-internals/std"] std = ["secp256k1/std", "bitcoin_hashes/std", "bech32/std", "bitcoin-internals/std"]
no-std = ["core2/alloc", "bitcoin_hashes/alloc", "secp256k1/alloc"] no-std = ["core2/alloc", "bitcoin_hashes/alloc", "bitcoin_hashes/core2", "secp256k1/alloc"]
[package.metadata.docs.rs] [package.metadata.docs.rs]
features = [ "std", "secp-recovery", "base64", "rand", "serde", "bitcoinconsensus" ] features = [ "std", "secp-recovery", "base64", "rand", "serde", "bitcoinconsensus" ]

View File

@ -19,13 +19,12 @@ schemars = ["actual-schemars", "dyn-clone"]
# If you disable std, you can still use a Write trait via the core2 feature. # If you disable std, you can still use a Write trait via the core2 feature.
# You can also use ToHex via the alloc feature, as it requires Vec/String. # You can also use ToHex via the alloc feature, as it requires Vec/String.
# And you can still just disable std by disabling default features, without enabling these two. # And you can still just disable std by disabling default features, without enabling these two.
alloc = ["core2/alloc", "internals/alloc"] alloc = ["internals/alloc"]
serde-std = ["serde/std"] serde-std = ["serde/std"]
[dependencies] [dependencies]
# Only enable this if you explicitly do not want to use "std", otherwise enable "serde-std". # Only enable this if you explicitly do not want to use "std", otherwise enable "serde-std".
serde = { version = "1.0", default-features = false, optional = true } serde = { version = "1.0", default-features = false, optional = true }
# Only enable this if you explicitly do not want to use an allocator, otherwise enable "alloc".
core2 = { version = "0.3.0", optional = true, default_features = false } core2 = { version = "0.3.0", optional = true, default_features = false }
# TODO: change to proper version before release # TODO: change to proper version before release
internals = { path = "../internals", package = "bitcoin-internals" } internals = { path = "../internals", package = "bitcoin-internals" }