From 132d2f90b698ddfb5ae3bde69e188518f4c5b568 Mon Sep 17 00:00:00 2001 From: "Tobin C. Harding" Date: Fri, 3 Feb 2023 10:13:49 +1100 Subject: [PATCH] bitcoin: Enable alloc feature in features list In `bitcoin` when we use the `core2` dependency we always need the "alloc" feature. Enabling "alloc" when enabling "core2" in the "no-std" feature is confusing because it makes it seem that we don't always need it. Set usage of the "alloc" feature of `core2` in the `features` list. --- bitcoin/Cargo.toml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitcoin/Cargo.toml b/bitcoin/Cargo.toml index 714471dc..5d1fd3c3 100644 --- a/bitcoin/Cargo.toml +++ b/bitcoin/Cargo.toml @@ -28,7 +28,7 @@ bitcoinconsensus-std = ["bitcoinconsensus/std", "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. std = ["secp256k1/std", "bitcoin_hashes/std", "bech32/std", "bitcoin-internals/std"] -no-std = ["core2/alloc", "bitcoin_hashes/alloc", "bitcoin_hashes/core2", "secp256k1/alloc"] +no-std = ["core2", "bitcoin_hashes/alloc", "bitcoin_hashes/core2", "secp256k1/alloc"] [package.metadata.docs.rs] features = [ "std", "secp-recovery", "base64", "rand", "serde", "bitcoinconsensus" ] @@ -39,10 +39,10 @@ bitcoin-internals = { path = "../internals" } bech32 = { version = "0.9.0", default-features = false } bitcoin_hashes = { version = "0.11.0", default-features = false } secp256k1 = { version = "0.25.0", default-features = false, features = ["bitcoin_hashes"] } -core2 = { version = "0.3.0", optional = true, default-features = false } base64 = { version = "0.13.0", optional = true } bitcoinconsensus = { version = "0.20.2-0.5.0", optional = true, default-features = false } +core2 = { version = "0.3.0", default-features = false, features = ["alloc"], optional = true } # Do NOT use this as a feature! Use the `serde` feature instead. actual-serde = { package = "serde", version = "1.0.103", default-features = false, features = [ "derive", "alloc" ], optional = true }