Skip to content
This repository was archived by the owner on Nov 30, 2022. It is now read-only.

Commit e740edf

Browse files
committed
Merge #167: Hack around the broken dyn-clone dependency
67aa7ac Hack around the broken dyn-clone dependency (Tobin C. Harding) Pull request description: The current version of `dyn-clone` v1.0.8 breaks our build (uses `Arc::as_ptr` which only became available in Rust 1.45). We can pin the dependency to a version before that works. Requires some toml magic akin to what we do with `actual-serde` in `rust-bitcoin`. ACKs for top commit: apoelstra: ACK 67aa7ac Tree-SHA512: 6045e94af6720e23c9c40b3aba29c88f43e60c4fcf3695d3dddb03e9bef07296d496c8199c43537c4a70eadaefdc92d8cb2ea3b2b3a142842dc68d8f5944a2a0
2 parents 701daf6 + 67aa7ac commit e740edf

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

Cargo.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ edition = "2018"
1414
[features]
1515
default = ["std"]
1616
std = []
17+
schemars = ["actual-schemars", "dyn-clone"]
1718
# If you disable std, you can still use a Write trait via the core2 feature.
1819
# You can also use ToHex via the alloc feature, as it requires Vec/String.
1920
# And you can still just disable std by disabling default features, without enabling these two.
@@ -24,11 +25,15 @@ unstable = [] # for benchmarking
2425
[dependencies]
2526
# Only enable this if you explicitly do not want to use "std", otherwise enable "serde-std".
2627
serde = { version = "1.0", default-features = false, optional = true }
27-
# Can only be used with "std" enabled.
28-
schemars = { version = "<=0.8.3", optional = true }
2928
# Only enable this if you explicitly do not want to use an allocator, otherwise enable "alloc".
3029
core2 = { version = "0.3.0", optional = true, default_features = false }
3130

31+
# Do NOT use this as a feature! Use the `schemars` feature instead. Can only be used with "std" enabled.
32+
actual-schemars = { package = "schemars", version = "<=0.8.3", optional = true }
33+
# Do NOT enable this dependency, this is just to pin dyn-clone (transitive dep from schemars)
34+
# because 1.0.8 does not build with Rust 1.41.1 (because of useage of `Arc::as_ptr`).
35+
dyn-clone = { version = "<=1.0.7", default_features = false, optional = true }
36+
3237
[dev-dependencies]
3338
serde_test = "1.0"
3439
serde_json = "1.0"

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ pub mod _export {
5555
}
5656
}
5757

58-
#[cfg(feature = "schemars")] extern crate schemars;
58+
#[cfg(feature = "schemars")]
59+
extern crate actual_schemars as schemars;
5960

6061
#[macro_use] mod util;
6162
#[macro_use] pub mod serde_macros;

0 commit comments

Comments
 (0)