Setting Rust version on CI - best practices


#1

Travis CI currently allows you to specify different Rust versions in their test matrix. It does so by installing the toolchain with

$ curl -sSf https://build.travis-ci.com/files/rustup-init.sh | sh -s -- --default-toolchain=$TRAVIS_RUST_VERSION -y

This works; if otherwise unspecified, this becomes the default toolchain and is used for any cargo invocations.

My problem came from the fact that I was using a rust-toolchain file to serve as a specification that the project was using the beta channel. This meant that the CI job using nightly for clippy was instead still using beta, as the rust-toolchain overrides the default.

Would it be more correct for Travis to set $RUSTUP_TOOLCHAIN here? Or is my usage of rust-toolchain here incorrect?