diff --git a/CHANGELOG.md b/CHANGELOG.md index 1fc561427..c2d71383e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# 0.29.1 - 2024-09-06 + +* Deprecate `hashes` reexport + + Because the reexport can have any of the *incompatible* versions using it is prone to breakage. + The `bitcoin_hashes` crate is not used in our API anyway, so you should just depend on it yourself + using a version range that's appropriate for your crate. +* Fix version range of the `bitcoin_hashes` crate. + # 0.29.0 - 2024-04-02 * Deprecate `ThirtyTwoByteHash` [#686](https://github.com/rust-bitcoin/rust-secp256k1/pull/686) diff --git a/Cargo-minimal.lock b/Cargo-minimal.lock index 209baba14..b3e2cc9df 100644 --- a/Cargo-minimal.lock +++ b/Cargo-minimal.lock @@ -257,7 +257,7 @@ checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2" [[package]] name = "secp256k1" -version = "0.29.0" +version = "0.29.1" dependencies = [ "bincode", "bitcoin_hashes", diff --git a/Cargo-recent.lock b/Cargo-recent.lock index 86a3094e5..eafcab858 100644 --- a/Cargo-recent.lock +++ b/Cargo-recent.lock @@ -178,7 +178,7 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" [[package]] name = "secp256k1" -version = "0.29.0" +version = "0.29.1" dependencies = [ "bincode", "bitcoin_hashes", diff --git a/Cargo.toml b/Cargo.toml index a1958d945..39c170aa8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "secp256k1" -version = "0.29.0" +version = "0.29.1" authors = [ "Dawid Ciężarkiewicz ", "Andrew Poelstra " ] license = "CC0-1.0" @@ -41,7 +41,7 @@ serde = { version = "1.0.103", default-features = false, optional = true } # You likely only want to enable these if you explicitly do not want to use "std", otherwise enable # the respective -std feature e.g., hashes-std -hashes = { package = "bitcoin_hashes", version = ">= 0.12, <= 0.14", default-features = false, optional = true } +hashes = { package = "bitcoin_hashes", version = ">= 0.12, < 0.15", default-features = false, optional = true } rand = { version = "0.8", default-features = false, optional = true } [dev-dependencies] @@ -54,6 +54,8 @@ bincode = "1.3.3" wasm-bindgen-test = "0.3" getrandom = { version = "0.2", features = ["js"] } +[lints.rust] +unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(secp256k1_fuzz)', 'cfg(rust_secp_no_symbol_renaming)'] } [[example]] name = "sign_verify_recovery" diff --git a/no_std_test/src/main.rs b/no_std_test/src/main.rs index eb3871f47..e93c2eb09 100644 --- a/no_std_test/src/main.rs +++ b/no_std_test/src/main.rs @@ -29,7 +29,6 @@ #![feature(start)] #![feature(core_intrinsics)] -#![feature(panic_info_message)] #![feature(alloc_error_handler)] #![no_std] extern crate libc; @@ -48,7 +47,7 @@ extern crate wee_alloc; #[global_allocator] static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; -use core::fmt::{self, write, Write}; +use core::fmt::{self, Write}; use core::intrinsics; use core::panic::PanicInfo; @@ -170,9 +169,9 @@ impl Write for Print { #[panic_handler] fn panic(info: &PanicInfo) -> ! { unsafe { libc::printf("shi1\n\0".as_ptr() as _) }; - let msg = info.message().unwrap(); + let msg = info.message(); let mut buf = Print::new(); - write(&mut buf, *msg).unwrap(); + write!(&mut buf, "{}", msg).unwrap(); buf.print(); intrinsics::abort() } diff --git a/secp256k1-sys/Cargo.toml b/secp256k1-sys/Cargo.toml index 5d591ffcb..1ca432045 100644 --- a/secp256k1-sys/Cargo.toml +++ b/secp256k1-sys/Cargo.toml @@ -32,3 +32,6 @@ recovery = [] lowmemory = [] std = ["alloc"] alloc = [] + +[lints.rust] +unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(secp256k1_fuzz)', 'cfg(rust_secp_no_symbol_renaming)'] } diff --git a/src/key.rs b/src/key.rs index 012f09d36..9a868980d 100644 --- a/src/key.rs +++ b/src/key.rs @@ -638,10 +638,9 @@ impl PublicKey { /// # } /// ``` pub fn combine_keys(keys: &[&PublicKey]) -> Result { - use core::i32::MAX; use core::mem::transmute; - if keys.is_empty() || keys.len() > MAX as usize { + if keys.is_empty() || keys.len() > i32::MAX as usize { return Err(InvalidPublicKeySum); } diff --git a/src/lib.rs b/src/lib.rs index 20ff5d44e..39b6713f4 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -153,8 +153,12 @@ extern crate core; #[cfg(bench)] extern crate test; +/// Deprecated reexport of the `bitcoin-hashes` crate. #[cfg(feature = "hashes")] -pub extern crate hashes; +#[deprecated(since = "0.29.1", note = "Depend on `hashes` in your own crate.")] +pub mod hashes { + pub use ::hashes::*; +} #[macro_use] mod macros;