steps:
  - bash: |
      set -e
      rustup set profile minimal
      rustup component remove --toolchain=$TOOLCHAIN rust-docs || echo "already removed"
      rustup update --no-self-update $TOOLCHAIN
      if [ "$TOOLCHAIN" = "nightly" ]; then
        rustup component add --toolchain=$TOOLCHAIN rustc-dev
      fi
      rustup default $TOOLCHAIN
    displayName: Install rust

  - bash: |
      set -ex
      rustup -V
      rustc -Vv
      cargo -V
    displayName: Query rust and cargo versions
