Skip to content

Commit 1a1fc57

Browse files
committed
Merge #732: Fix hashes version range in 0.29.1
f74877a Release version 0.29.1 (Martin Habovstiak) 7ad2f2e Don't use `core::i32::MAX` (Martin Habovstiak) 05c5937 Update panic message handling (Martin Habovstiak) 938dba6 Whitelist known cfgs (Martin Habovstiak) ad69619 Fix the `hashes` dependency range. (Martin Habovstiak) caf2f1a Deprecate the `hashes` reexport (Martin Habovstiak) Pull request description: See rust-bitcoin/rust-bitcoin#3296 (comment) ACKs for top commit: apoelstra: ACK f74877a; tested final commit locally Tree-SHA512: adebf04d91e46c7952b7bc3a2cfa64c2d372a6c7295e57c356be72862292e23e7d8e04be47843634cb7680272894f1c66414ebc1e724abaec025938312d89901
2 parents 6648126 + f74877a commit 1a1fc57

File tree

8 files changed

+27
-11
lines changed

8 files changed

+27
-11
lines changed

CHANGELOG.md

+9
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# 0.29.1 - 2024-09-06
2+
3+
* Deprecate `hashes` reexport
4+
5+
Because the reexport can have any of the *incompatible* versions using it is prone to breakage.
6+
The `bitcoin_hashes` crate is not used in our API anyway, so you should just depend on it yourself
7+
using a version range that's appropriate for your crate.
8+
* Fix version range of the `bitcoin_hashes` crate.
9+
110
# 0.29.0 - 2024-04-02
211

312
* Deprecate `ThirtyTwoByteHash` [#686](https://github.com/rust-bitcoin/rust-secp256k1/pull/686)

Cargo-minimal.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ checksum = "ea6a9290e3c9cf0f18145ef7ffa62d68ee0bf5fcd651017e586dc7fd5da448c2"
257257

258258
[[package]]
259259
name = "secp256k1"
260-
version = "0.29.0"
260+
version = "0.29.1"
261261
dependencies = [
262262
"bincode",
263263
"bitcoin_hashes",

Cargo-recent.lock

+1-1
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@ checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294"
178178

179179
[[package]]
180180
name = "secp256k1"
181-
version = "0.29.0"
181+
version = "0.29.1"
182182
dependencies = [
183183
"bincode",
184184
"bitcoin_hashes",

Cargo.toml

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "secp256k1"
3-
version = "0.29.0"
3+
version = "0.29.1"
44
authors = [ "Dawid Ciężarkiewicz <dpc@ucore.info>",
55
"Andrew Poelstra <apoelstra@wpsoftware.net>" ]
66
license = "CC0-1.0"
@@ -41,7 +41,7 @@ serde = { version = "1.0.103", default-features = false, optional = true }
4141

4242
# You likely only want to enable these if you explicitly do not want to use "std", otherwise enable
4343
# the respective -std feature e.g., hashes-std
44-
hashes = { package = "bitcoin_hashes", version = ">= 0.12, <= 0.14", default-features = false, optional = true }
44+
hashes = { package = "bitcoin_hashes", version = ">= 0.12, < 0.15", default-features = false, optional = true }
4545
rand = { version = "0.8", default-features = false, optional = true }
4646

4747
[dev-dependencies]
@@ -54,6 +54,8 @@ bincode = "1.3.3"
5454
wasm-bindgen-test = "0.3"
5555
getrandom = { version = "0.2", features = ["js"] }
5656

57+
[lints.rust]
58+
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(secp256k1_fuzz)', 'cfg(rust_secp_no_symbol_renaming)'] }
5759

5860
[[example]]
5961
name = "sign_verify_recovery"

no_std_test/src/main.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
3030
#![feature(start)]
3131
#![feature(core_intrinsics)]
32-
#![feature(panic_info_message)]
3332
#![feature(alloc_error_handler)]
3433
#![no_std]
3534
extern crate libc;
@@ -48,7 +47,7 @@ extern crate wee_alloc;
4847
#[global_allocator]
4948
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
5049

51-
use core::fmt::{self, write, Write};
50+
use core::fmt::{self, Write};
5251
use core::intrinsics;
5352
use core::panic::PanicInfo;
5453

@@ -170,9 +169,9 @@ impl Write for Print {
170169
#[panic_handler]
171170
fn panic(info: &PanicInfo) -> ! {
172171
unsafe { libc::printf("shi1\n\0".as_ptr() as _) };
173-
let msg = info.message().unwrap();
172+
let msg = info.message();
174173
let mut buf = Print::new();
175-
write(&mut buf, *msg).unwrap();
174+
write!(&mut buf, "{}", msg).unwrap();
176175
buf.print();
177176
intrinsics::abort()
178177
}

secp256k1-sys/Cargo.toml

+3
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ recovery = []
3232
lowmemory = []
3333
std = ["alloc"]
3434
alloc = []
35+
36+
[lints.rust]
37+
unexpected_cfgs = { level = "deny", check-cfg = ['cfg(bench)', 'cfg(secp256k1_fuzz)', 'cfg(rust_secp_no_symbol_renaming)'] }

src/key.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -638,10 +638,9 @@ impl PublicKey {
638638
/// # }
639639
/// ```
640640
pub fn combine_keys(keys: &[&PublicKey]) -> Result<PublicKey, Error> {
641-
use core::i32::MAX;
642641
use core::mem::transmute;
643642

644-
if keys.is_empty() || keys.len() > MAX as usize {
643+
if keys.is_empty() || keys.len() > i32::MAX as usize {
645644
return Err(InvalidPublicKeySum);
646645
}
647646

src/lib.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -153,8 +153,12 @@ extern crate core;
153153
#[cfg(bench)]
154154
extern crate test;
155155

156+
/// Deprecated reexport of the `bitcoin-hashes` crate.
156157
#[cfg(feature = "hashes")]
157-
pub extern crate hashes;
158+
#[deprecated(since = "0.29.1", note = "Depend on `hashes` in your own crate.")]
159+
pub mod hashes {
160+
pub use ::hashes::*;
161+
}
158162

159163
#[macro_use]
160164
mod macros;

0 commit comments

Comments
 (0)