File tree Expand file tree Collapse file tree 6 files changed +27
-7
lines changed Expand file tree Collapse file tree 6 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -17,7 +17,6 @@ no-std = ["hashbrown", "bitcoin/no-std"]
17
17
compiler = []
18
18
trace = []
19
19
20
- unstable = []
21
20
serde = [" actual-serde" , " bitcoin/serde" ]
22
21
rand = [" bitcoin/rand" ]
23
22
base64 = [" bitcoin/base64" ]
Original file line number Diff line number Diff line change @@ -61,6 +61,11 @@ architectural mismatches. If you have any questions or ideas you want to discuss
61
61
please join us in
62
62
[ ##miniscript] ( https://web.libera.chat/?channels=##miniscript ) on Libera.
63
63
64
+ ## Benchmarks
65
+
66
+ We use a custom Rust compiler configuration conditional to guard the bench mark code. To run the
67
+ bench marks use: ` RUSTFLAGS='--cfg=bench' cargo +nightly bench ` .
68
+
64
69
65
70
## Release Notes
66
71
Original file line number Diff line number Diff line change @@ -7,6 +7,12 @@ FEATURES="compiler serde rand base64"
7
7
cargo --version
8
8
rustc --version
9
9
10
+ # Cache the toolchain we are using.
11
+ NIGHTLY=false
12
+ if cargo --version | grep nightly; then
13
+ NIGHTLY=true
14
+ fi
15
+
10
16
# Format if told to
11
17
if [ " $DO_FMT " = true ]
12
18
then
80
86
done
81
87
fi
82
88
83
- # Bench if told to (this only works with the nightly toolchain)
89
+ # Bench if told to, only works with non-stable toolchain ( nightly, beta).
84
90
if [ " $DO_BENCH " = true ]
85
91
then
86
- cargo bench --features=" unstable compiler"
92
+ if [ " $NIGHTLY " = false ]; then
93
+ if [ -n " $RUSTUP_TOOLCHAIN " ]; then
94
+ echo " RUSTUP_TOOLCHAIN is set to a non-nightly toolchain but DO_BENCH requires a nightly toolchain"
95
+ else
96
+ echo " DO_BENCH requires a nightly toolchain"
97
+ fi
98
+ exit 1
99
+ fi
100
+ RUSTFLAGS=' --cfg=bench' cargo bench
87
101
fi
88
102
89
103
# Build the docs if told to (this only works with the nightly toolchain)
Original file line number Diff line number Diff line change 74
74
//!
75
75
76
76
#![ cfg_attr( all( not( feature = "std" ) , not( test) ) , no_std) ]
77
- #![ cfg_attr( all( test, feature = "unstable" ) , feature( test) ) ]
77
+ // Experimental features we need.
78
+ #![ cfg_attr( bench, feature( test) ) ]
78
79
// Coding conventions
79
80
#![ deny( unsafe_code) ]
80
81
#![ deny( non_upper_case_globals) ]
@@ -107,7 +108,8 @@ extern crate core;
107
108
108
109
#[ cfg( feature = "serde" ) ]
109
110
pub use actual_serde as serde;
110
- #[ cfg( all( test, feature = "unstable" ) ) ]
111
+
112
+ #[ cfg( bench) ]
111
113
extern crate test;
112
114
113
115
#[ macro_use]
Original file line number Diff line number Diff line change @@ -1601,7 +1601,7 @@ mod tests {
1601
1601
}
1602
1602
}
1603
1603
1604
- #[ cfg( all ( test , feature = "unstable" ) ) ]
1604
+ #[ cfg( bench ) ]
1605
1605
mod benches {
1606
1606
use std:: str:: FromStr ;
1607
1607
Original file line number Diff line number Diff line change @@ -541,7 +541,7 @@ mod tests {
541
541
}
542
542
}
543
543
544
- #[ cfg( all ( test , feature = "compiler" , feature = "unstable" ) ) ]
544
+ #[ cfg( bench ) ]
545
545
mod benches {
546
546
use core:: str:: FromStr ;
547
547
You can’t perform that action at this time.
0 commit comments