File tree 2 files changed +8
-7
lines changed 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 3
3
set -xeu
4
4
cd " $( dirname " $0 " ) /.."
5
5
6
- rustup update nightly
7
- rustup component add rustfmt --toolchain nightly
6
+ TOOLCHAIN=" nightly-$( curl https://rust-lang.github.io/rustup-components-history/$( rustup target list --installed | tail -1) /rustfmt) "
7
+ rustup update " $TOOLCHAIN "
8
+ rustup component add rustfmt --toolchain " $TOOLCHAIN "
8
9
9
10
# Run `rustfmt` on the crate! If `rustfmt` can't make a long line shorter, it
10
11
# prints an error and exits non-zero, so tell it to kindly shut its yapper and
11
12
# make sure it doesn't cause us to exit this whole script non-zero.
12
- rustup run nightly cargo fmt -- --check
13
+ rustup run " $TOOLCHAIN " cargo fmt -- --check
Original file line number Diff line number Diff line change 17
17
case " $BINDGEN_JOB " in
18
18
" test" )
19
19
# Need rustfmt to compare the test expectations.
20
- rustup update nightly
21
- rustup component add rustfmt
22
- rustup component add --toolchain nightly rustfmt
23
- RUSTFMT=" $( rustup which rustfmt) "
20
+ TOOLCHAIN= " nightly- $( curl https://rust-lang.github.io/ rustup-components-history/ $( rustup target list --installed | tail -1 ) /rustfmt ) "
21
+ rustup update " $TOOLCHAIN "
22
+ rustup component add rustfmt --toolchain " $TOOLCHAIN "
23
+ RUSTFMT=" $( rustup which --toolchain " $TOOLCHAIN " rustfmt) "
24
24
export RUSTFMT
25
25
cargo test " $BINDGEN_PROFILE " $NO_DEFAULT_FEATURES --features " $BINDGEN_FEATURES "
26
26
./ci/assert-no-diff.sh
You can’t perform that action at this time.
0 commit comments