Skip to content

Add setup-toolchain.sh script to configure the master version of rustc, #3735

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions ci/base-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

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

# switch back to master
rustup default master
rustup override set master
9 changes: 9 additions & 0 deletions setup-toolchain.sh
Original file line number Diff line number Diff line change
@@ -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