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 @@ -54,6 +54,11 @@ architectural mismatches. If you have any questions or ideas you want to discuss
54
54
please join us in
55
55
[ ##miniscript] ( https://web.libera.chat/?channels=##miniscript ) on Libera.
56
56
57
+ ## Benchmarks
58
+
59
+ We use a custom Rust compiler configuration conditional to guard the bench mark code. To run the
60
+ bench marks use: ` RUSTFLAGS='--cfg=bench' cargo +nightly bench ` .
61
+
57
62
58
63
## Release Notes
59
64
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
82
88
done
83
89
fi
84
90
85
- # Bench if told to (this only works with the nightly toolchain)
91
+ # Bench if told to, only works with non-stable toolchain ( nightly, beta).
86
92
if [ " $DO_BENCH " = true ]
87
93
then
88
- cargo bench --features=" unstable compiler"
94
+ if [ " $NIGHTLY " = false ]; then
95
+ if [ -n " $RUSTUP_TOOLCHAIN " ]; then
96
+ echo " RUSTUP_TOOLCHAIN is set to a non-nightly toolchain but DO_BENCH requires a nightly toolchain"
97
+ else
98
+ echo " DO_BENCH requires a nightly toolchain"
99
+ fi
100
+ exit 1
101
+ fi
102
+ RUSTFLAGS=' --cfg=bench' cargo bench
89
103
fi
90
104
91
105
# 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 @@ -1588,7 +1588,7 @@ mod tests {
1588
1588
}
1589
1589
}
1590
1590
1591
- #[ cfg( all ( test , feature = "unstable" ) ) ]
1591
+ #[ cfg( bench ) ]
1592
1592
mod benches {
1593
1593
use std:: str:: FromStr ;
1594
1594
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