Set rustv_1_53 in build script

The rust version is supposed to be set by the build script so that users
automagically get features matching the toolchain in use. Currently we
have a feature in the manifest for `rustv_1_53` instead setting a
compiler conditional configuration option in the build script. This
causes `cargo +1.41.1 --all-features check` to fail.
This commit is contained in:
Tobin C. Harding 2023-02-02 10:12:16 +11:00
parent f52301151c
commit bb612fdafa
No known key found for this signature in database
GPG Key ID: 40BF9E4C269D6607
3 changed files with 4 additions and 5 deletions

View File

@ -21,7 +21,6 @@ serde = ["actual-serde", "bitcoin_hashes/serde", "secp256k1/serde"]
secp-lowmemory = ["secp256k1/lowmemory"]
secp-recovery = ["secp256k1/recovery"]
bitcoinconsensus-std = ["bitcoinconsensus/std", "std"]
rust_v_1_53 = []
# At least one of std, no-std must be enabled.
#

View File

@ -23,7 +23,7 @@ fn main() {
.parse::<u64>()
.expect("invalid Rust minor version");
for activate_version in &[46] {
for activate_version in &[46, 53] {
if minor >= *activate_version {
println!("cargo:rustc-cfg=rust_v_1_{}", activate_version);
}

View File

@ -59,7 +59,7 @@ use core::convert::TryFrom;
use core::borrow::{Borrow, BorrowMut};
use core::{fmt, default::Default};
use core::ops::{Deref, DerefMut, Index, Range, RangeFull, RangeFrom, RangeTo, RangeInclusive, RangeToInclusive};
#[cfg(feature = "rust_v_1_53")]
#[cfg(rust_v_1_53)]
use core::ops::Bound;
#[cfg(feature = "serde")] use serde;
@ -615,8 +615,8 @@ macro_rules! delegate_index {
}
delegate_index!(Range<usize>, RangeFrom<usize>, RangeTo<usize>, RangeFull, RangeInclusive<usize>, RangeToInclusive<usize>);
#[cfg(feature = "rust_v_1_53")]
#[cfg_attr(docsrs, doc(cfg(feature = "rust_v_1_53")))]
#[cfg(rust_v_1_53)]
#[cfg_attr(docsrs, doc(cfg(rust_v_1_53)))]
delegate_index!((Bound<usize>, Bound<usize>));
impl AsRef<Script> for Script {