]> git.lizzy.rs Git - rust.git/blob - setup-toolchain.sh
Use infer_ctxt
[rust.git] / setup-toolchain.sh
1 #!/bin/bash
2 # Set up the appropriate rustc toolchain
3
4 set -e
5
6 cd "$(dirname "$0")"
7
8 RTIM_PATH=$(command -v rustup-toolchain-install-master)
9 CARGO_HOME=${CARGO_HOME:-$HOME/.cargo}
10
11 # Check if people also install RTIM in other locations beside
12 # ~/.cargo/bin
13 if [[ "$RTIM_PATH" == $CARGO_HOME/bin/rustup-toolchain-install-master ]]; then
14     cargo +nightly install rustup-toolchain-install-master
15 else
16     VERSION=$(rustup-toolchain-install-master -V | grep -o "[0-9.]*")
17     REMOTE=$(cargo search rustup-toolchain-install-master | grep -o "[0-9.]*")
18     echo "info: skipping updating rustup-toolchain-install-master at $RTIM_PATH"
19     echo "      current version : $VERSION"
20     echo "      remote version  : $REMOTE"
21 fi
22
23 RUST_COMMIT=$(git ls-remote https://github.com/rust-lang/rust master | awk '{print $1}')
24
25 if rustc +master -Vv 2>/dev/null | grep -q "$RUST_COMMIT"; then
26     echo "info: master toolchain is up-to-date"
27     exit 0
28 fi
29
30 rustup-toolchain-install-master -f -n master -c rustc-dev -- "$RUST_COMMIT"
31 rustup override set master