about summary refs log tree commit diff
diff options
context:
space:
mode:
authorJeremy Fitzhardinge <jeremy@goop.org>2019-02-02 11:54:18 -0800
committerJeremy Fitzhardinge <jeremy@goop.org>2019-02-03 14:41:46 -0800
commit47563a13eba19d0fc4b56f2cd0d5645fc81e7bc3 (patch)
tree7022ad23287e1ba009bcc59fa43682546f79799b
parent27b5dd8886ac0423e059c0817b55a4e618b344a0 (diff)
downloadrust-47563a13eba19d0fc4b56f2cd0d5645fc81e7bc3.tar.gz
rust-47563a13eba19d0fc4b56f2cd0d5645fc81e7bc3.zip
Add setup-toolchain.sh script to configure the master version of rustc,
and update CONTRIBUTING.md accordingly.
-rw-r--r--.travis.yml5
-rw-r--r--CONTRIBUTING.md4
-rwxr-xr-xci/base-tests.sh4
-rwxr-xr-xsetup-toolchain.sh9
4 files changed, 16 insertions, 6 deletions
diff --git a/.travis.yml b/.travis.yml
index d7b26225518..acb5b9ae0d2 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -90,10 +90,7 @@ matrix:
 script:
   - |
       rm rust-toolchain
-      cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
-      RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
-      travis_retry rustup-toolchain-install-master -f -n master $RUSTC_HASH
-      rustup default master
+      ./setup-toolchain.sh
       export LD_LIBRARY_PATH=$(rustc --print sysroot)/lib
   - |
     if [ -z ${INTEGRATION} ]; then
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 415fb7ab0d7..5619ee00f8d 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -73,6 +73,10 @@ an AST expression). `match_def_path()` in Clippy's `utils` module can also be us
 
 ## Writing code
 
+Clippy depends on the current git master version of rustc, which can change rapidly. Make sure you're
+working near rust-clippy's master, and use the `setup-toolchain.sh` script to configure the appropriate
+toolchain for this directory.
+
 [Llogiq's blog post on lints](https://llogiq.github.io/2015/06/04/workflows.html) is a nice primer
 to lint-writing, though it does get into advanced stuff. Most lints consist of an implementation of
 `LintPass` with one or more of its default methods overridden. See the existing lints for examples
diff --git a/ci/base-tests.sh b/ci/base-tests.sh
index 6675c795b3b..3ac6bbe6725 100755
--- a/ci/base-tests.sh
+++ b/ci/base-tests.sh
@@ -29,7 +29,7 @@ cargo +nightly fmt --all -- --check
 # some lints are sensitive to formatting, exclude some files
 tests_need_reformatting="false"
 # switch to nightly
-rustup default nightly
+rustup override set nightly
 # avoid loop spam and allow cmds with exit status != 0
 set +ex
 
@@ -49,4 +49,4 @@ if [ "${tests_need_reformatting}" == "true" ] ; then
 fi
 
 # switch back to master
-rustup default master
+rustup override set master
diff --git a/setup-toolchain.sh b/setup-toolchain.sh
new file mode 100755
index 00000000000..f8d764b6132
--- /dev/null
+++ b/setup-toolchain.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+# Set up the appropriate rustc toolchain
+
+cd $(dirname $0)
+
+cargo install rustup-toolchain-install-master --debug || echo "rustup-toolchain-install-master already installed"
+RUSTC_HASH=$(git ls-remote https://github.com/rust-lang/rust.git master | awk '{print $1}')
+rustup-toolchain-install-master -f -n master $RUSTC_HASH
+rustup override set master