From 4b0c1b724f06939401320a5c0a982610e11f5047 Mon Sep 17 00:00:00 2001 From: Taiki Endo Date: Sun, 4 Aug 2019 23:50:48 +0900 Subject: [PATCH] ci: Use the latest toolchain with clippy available if clippy is unavailable on the latest nightly --- .travis.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.travis.yml b/.travis.yml index 2441997963..bf3e675560 100644 --- a/.travis.yml +++ b/.travis.yml @@ -62,12 +62,14 @@ matrix: - name: cargo clippy rust: nightly script: - - if rustup component add clippy-preview; - then - cargo clippy --all --all-features; - else - echo 'Skipping clippy'; + - if ! rustup component add clippy; then + target=`curl https://rust-lang.github.io/rustup-components-history/x86_64-unknown-linux-gnu/clippy`; + echo "'clippy' is unavailable on the toolchain 'nightly', use the toolchain 'nightly-$target' instead"; + rustup toolchain install nightly-$target; + rustup default nightly-$target; + rustup component add clippy; fi + - cargo clippy --all --all-features - name: cargo bench rust: nightly