Skip to content

Commit 7bea436

Browse files
authored
Merge pull request #3735 from jsgf/setup-toolchain
Add setup-toolchain.sh script to configure the master version of rustc,
2 parents 69a7f03 + 47563a1 commit 7bea436

File tree

4 files changed

+16
-6
lines changed

4 files changed

+16
-6
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -90,10 +90,7 @@ matrix:
9090
script:
9191
- |
9292
rm rust-toolchain
93-
cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
94-
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
95-
travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH
96-
rustup default master
93+
./setup-toolchain.sh
9794
export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
9895
- |
9996
if [ -z ${INTEGRATION} ]; then

CONTRIBUTING.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,10 @@ an AST expression). `match_def_path()` in Clippy's `utils` module can also be us
7373

7474
## Writing code
7575

76+
Clippy depends on the current git master version of rustc, which can change rapidly. Make sure you're
77+
working near rust-clippy's master, and use the `setup-toolchain.sh` script to configure the appropriate
78+
toolchain for this directory.
79+
7680
[Llogiq's blog post on lints](https://llogiq.github.io/2015/06/04/workflows.html) is a nice primer
7781
to lint-writing, though it does get into advanced stuff. Most lints consist of an implementation of
7882
`LintPass` with one or more of its default methods overridden. See the existing lints for examples

ci/base-tests.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ cargo +nightly fmt --all -- --check
2929
# some lints are sensitive to formatting, exclude some files
3030
tests_need_reformatting="false"
3131
# switch to nightly
32-
rustup default nightly
32+
rustup override set nightly
3333
# avoid loop spam and allow cmds with exit status != 0
3434
set +ex
3535

@@ -49,4 +49,4 @@ if [ "${tests_need_reformatting}" == "true" ] ; then
4949
fi
5050

5151
# switch back to master
52-
rustup default master
52+
rustup override set master

setup-toolchain.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/bash
2+
# Set up the appropriate rustc toolchain
3+
4+
cd $(dirname $0)
5+
6+
cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
7+
RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
8+
rustup-toolchain-install-master -f -n master $RUSTC_HASH
9+
rustup override set master

0 commit comments

Comments
 (0)