File tree Expand file tree Collapse file tree 5 files changed +22
-9
lines changed Expand file tree Collapse file tree 5 files changed +22
-9
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
Original file line number Diff line number Diff line change @@ -10,16 +10,20 @@ cargo update -p serde_derive --precise 1.0.142
10
10
cargo --version
11
11
rustc --version
12
12
13
- # Work out if we are using a nightly toolchain.
13
+ # Cache the toolchain we are using.
14
+ NIGHTLY=false
15
+ if cargo --version | grep nightly; then
16
+ NIGHTLY=true
17
+ fi
14
18
MSRV=false
15
19
if cargo --version | grep " 1\.41\.0" ; then
16
20
MSRV=true
17
21
fi
18
22
23
+ # Do pinning based on toolchain.
19
24
if cargo --version | grep " 1\.47\.0" ; then
20
25
cargo update -p once_cell --precise 1.13.1
21
26
fi
22
-
23
27
# form_urlencoded 1.1.0 breaks MSRV.
24
28
if [ " $MSRV " = true ]; then
25
29
cargo update -p url --precise 2.2.2
88
92
done
89
93
fi
90
94
91
- # Bench if told to (this only works with the nightly toolchain)
95
+ # Bench if told to, only works with non-stable toolchain ( nightly, beta).
92
96
if [ " $DO_BENCH " = true ]
93
97
then
94
- cargo bench --features=" unstable compiler"
98
+ if [ " $NIGHTLY " = false ]; then
99
+ if [ -n " $RUSTUP_TOOLCHAIN " ]; then
100
+ echo " RUSTUP_TOOLCHAIN is set to a non-nightly toolchain but DO_BENCH requires a nightly toolchain"
101
+ else
102
+ echo " DO_BENCH requires a nightly toolchain"
103
+ fi
104
+ exit 1
105
+ fi
106
+ RUSTFLAGS=' --cfg=bench' cargo bench
95
107
fi
96
108
97
109
# Build the docs if told to (this only works with the nightly toolchain)
Original file line number Diff line number Diff line change 79
79
//!
80
80
81
81
#![ cfg_attr( all( not( feature = "std" ) , not( test) ) , no_std) ]
82
- #![ cfg_attr( all( test, feature = "unstable" ) , feature( test) ) ]
82
+ // Experimental features we need.
83
+ #![ cfg_attr( bench, feature( test) ) ]
83
84
// Coding conventions
84
85
#![ deny( unsafe_code) ]
85
86
#![ deny( non_upper_case_globals) ]
@@ -109,7 +110,8 @@ extern crate core;
109
110
110
111
#[ cfg( feature = "serde" ) ]
111
112
pub use actual_serde as serde;
112
- #[ cfg( all( test, feature = "unstable" ) ) ]
113
+
114
+ #[ cfg( bench) ]
113
115
extern crate test;
114
116
115
117
#[ macro_use]
Original file line number Diff line number Diff line change @@ -1613,7 +1613,7 @@ mod tests {
1613
1613
}
1614
1614
}
1615
1615
1616
- #[ cfg( all ( test , feature = "unstable" ) ) ]
1616
+ #[ cfg( bench ) ]
1617
1617
mod benches {
1618
1618
use std:: str:: FromStr ;
1619
1619
Original file line number Diff line number Diff line change @@ -553,7 +553,7 @@ mod tests {
553
553
}
554
554
}
555
555
556
- #[ cfg( all ( test , feature = "compiler" , feature = "unstable" ) ) ]
556
+ #[ cfg( bench ) ]
557
557
mod benches {
558
558
use core:: str:: FromStr ;
559
559
You can’t perform that action at this time.
0 commit comments