Skip to content

Remove unstable feature #482

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

Merged
merged 1 commit into from
Jul 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ no-std = ["hashbrown", "bitcoin/no-std"]
compiler = []
trace = []

unstable = []
serde = ["actual-serde", "bitcoin/serde"]
rand = ["bitcoin/rand"]
base64 = ["bitcoin/base64"]
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ architectural mismatches. If you have any questions or ideas you want to discuss
please join us in
[##miniscript](https://web.libera.chat/?channels=##miniscript) on Libera.

## Benchmarks

We use a custom Rust compiler configuration conditional to guard the bench mark code. To run the
bench marks use: `RUSTFLAGS='--cfg=bench' cargo +nightly bench`.


## Release Notes

Expand Down
18 changes: 16 additions & 2 deletions contrib/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ FEATURES="compiler serde rand base64"
cargo --version
rustc --version

# Cache the toolchain we are using.
NIGHTLY=false
if cargo --version | grep nightly; then
NIGHTLY=true
fi

# Format if told to
if [ "$DO_FMT" = true ]
then
Expand Down Expand Up @@ -77,10 +83,18 @@ then
done
fi

# Bench if told to (this only works with the nightly toolchain)
# Bench if told to, only works with non-stable toolchain (nightly, beta).
if [ "$DO_BENCH" = true ]
then
cargo bench --features="unstable compiler"
if [ "$NIGHTLY" = false ]; then
if [ -n "$RUSTUP_TOOLCHAIN" ]; then
echo "RUSTUP_TOOLCHAIN is set to a non-nightly toolchain but DO_BENCH requires a nightly toolchain"
else
echo "DO_BENCH requires a nightly toolchain"
fi
exit 1
fi
RUSTFLAGS='--cfg=bench' cargo bench
fi

# Build the docs if told to (this only works with the nightly toolchain)
Expand Down
6 changes: 4 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@
//!

#![cfg_attr(all(not(feature = "std"), not(test)), no_std)]
#![cfg_attr(all(test, feature = "unstable"), feature(test))]
// Experimental features we need.
#![cfg_attr(bench, feature(test))]
// Coding conventions
#![deny(unsafe_code)]
#![deny(non_upper_case_globals)]
Expand Down Expand Up @@ -107,7 +108,8 @@ extern crate core;

#[cfg(feature = "serde")]
pub use actual_serde as serde;
#[cfg(all(test, feature = "unstable"))]

#[cfg(bench)]
extern crate test;

#[macro_use]
Expand Down
2 changes: 1 addition & 1 deletion src/policy/compiler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1598,7 +1598,7 @@ mod tests {
}
}

#[cfg(all(test, feature = "unstable"))]
#[cfg(bench)]
mod benches {
use std::str::FromStr;

Expand Down
2 changes: 1 addition & 1 deletion src/policy/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -541,7 +541,7 @@ mod tests {
}
}

#[cfg(all(test, feature = "compiler", feature = "unstable"))]
#[cfg(all(bench, feature = "compiler"))]
mod benches {
use core::str::FromStr;

Expand Down