Skip to content

Conversation

@tcharding
Copy link
Member

We currently have the feature gating incorrect in a few places, thread_rng requires "rand-std".

Found while doing rust-bitcoin/rust-bitcoin#1387

We currently have the feature gating incorrect in a few places,
`thread_rng` requires "rand-std".

#[bench]
#[cfg(any(feature = "alloc", feature = "std"))]
#[cfg(all(feature = "std", feature = "rnd-std"))]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rand-std should imply std so just rand-std should be sufficient but currently it's not the case - this is a bug. Also you seem to be missing a, so if you're going to fix it anyway might as well add std to the Cargo.toml list.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lol, this broken change makes the PR title amusing :)

@tcharding
Copy link
Member Author

Superseded by #520

@tcharding tcharding closed this Nov 17, 2022
apoelstra added a commit to rust-bitcoin/rust-bitcoin that referenced this pull request Dec 30, 2022
941083e Remove rand-std dev-dependency from secp256k1 (Tobin C. Harding)
f71335f Add rand-std feature (Tobin C. Harding)

Pull request description:

  This PR uncovered incorrect feature gating in `secp256k1`, fixed in rust-bitcoin/rust-secp256k1#519

  Currently we enable "secp256k1/rand-std" in the "rand" feature, this is incorrect because it means "rand" implies "std" which it does not.

  Add a "rand-std" feature that turns on "seck256k1/rand-std" and make the "rand" feature turn on "seck256k1/rand".

  Fix: #1384

ACKs for top commit:
  sanket1729:
    ACK 941083e
  apoelstra:
    ACK 941083e

Tree-SHA512: e1d12196766c2b3082b488fe7d0c03a865ebbfc70ffa6f128c57074df14da71e56c31ea92982991d376ac62fa86c6639049ce17aac93613b523ddcc99677c269
@tcharding tcharding deleted the 11-17-bench-rand-std branch October 9, 2023 22:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants