Skip to content

Commit 8a7db0f

Browse files
committed
Add setup-toolchain.sh script to configure the master version of rustc,
and update CONTRIBUTING.md accordingly.
1 parent 27b5dd8 commit 8a7db0f

File tree

3 files changed

+14
-4
lines changed

3 files changed

+14
-4
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

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)