From b78c6ce742374ef380e143876889f7cb3ea463eb Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 7 Nov 2023 10:14:55 +0000 Subject: [PATCH 1/2] rustfmt: use nightly in CI --- .github/workflows/pull-request.yml | 4 ++-- rustfmt.toml | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 rustfmt.toml diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 1211692fa38..20c15c72fc7 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -28,11 +28,11 @@ jobs: - name: Set env vars run: | source ci/rust-version.sh - echo "RUST_STABLE=$rust_stable" >> $GITHUB_ENV + echo "RUST_NIGHTLY=$rust_nightly" >> $GITHUB_ENV - uses: actions-rs/toolchain@v1 with: - toolchain: ${{ env.RUST_STABLE }} + toolchain: ${{ env.RUST_NIGHTLY }} override: true profile: minimal components: rustfmt diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 00000000000..36c419bb3e5 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1 @@ +edition = "2021" \ No newline at end of file From 266bc514435556cebade74bd53e5527664ce6d31 Mon Sep 17 00:00:00 2001 From: Joe Date: Tue, 7 Nov 2023 12:01:00 +0000 Subject: [PATCH 2/2] add nightly script --- cargo-nightly.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 cargo-nightly.sh diff --git a/cargo-nightly.sh b/cargo-nightly.sh new file mode 100644 index 00000000000..fc885367b67 --- /dev/null +++ b/cargo-nightly.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +here=$(dirname "$0") +source "${here}"/ci/rust-version.sh nightly +# shellcheck disable=SC2054 # rust_nightly is sourced from rust-version.sh +toolchain="$rust_nightly" +set -x +exec cargo "+${toolchain}" "${@}" \ No newline at end of file