Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New alloc feature #300

Merged
merged 1 commit into from
Jun 9, 2021
Merged

New alloc feature #300

merged 1 commit into from
Jun 9, 2021

Conversation

devrandom
Copy link
Contributor

Allows use of Secp256k1::new and related API, if an allocator is available

src/lib.rs Outdated
#[cfg(feature = "alloc")] extern crate alloc;

#[cfg(all(feature = "std", feature = "alloc"))]
compile_error!("std and alloc are mutually exclusive");
Copy link
Contributor

Choose a reason for hiding this comment

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

I've done the same in another PR rust-bitcoin/bitcoin_hashes#127

however, this causes an issue with how current resolver threat dependencies, taking the union of features if different crates specify different features. New resolver fixes this issue https://blog.rust-lang.org/2021/03/25/Rust-1.51.0.html#cargos-new-feature-resolver but it's much more modern than our MSRV

Copy link
Contributor Author

Choose a reason for hiding this comment

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

so are you thinking that if they are both set, then we should act as if std only is set?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a fixup for this

TheBlueMatt
TheBlueMatt previously approved these changes May 18, 2021
@apoelstra
Copy link
Member

needs rebase

Allows use of `Secp256k1::new` and related API if an allocator is available
@devrandom
Copy link
Contributor Author

rebased

@elichai elichai merged commit 65a2b4f into rust-bitcoin:master Jun 9, 2021
@elichai
Copy link
Member

elichai commented Jun 9, 2021

Reminder that when our MSRV hits 1.36 we could simplify and remove a bunch of these cfg conditions and use alloc by default

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.

None yet

6 participants