Skip to content

Commit 6ab91cb

Browse files
committed
Drop the rustup-specific calling in ci/rustfmt.sh
The +rustversion call semantics are specific to rustup and do not work with standard rust toolchains. However, because rustfmt formatting differs slightly between stable and our 1.63 target, we need to keep the +1.63.0 for rustup users. Thus, here, we check for the presence of a `rustup` command and pass the "+1.63.0" argument if we find one.
1 parent eeea0f4 commit 6ab91cb

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ci/rustfmt.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ set -eox pipefail
44
# Generate initial exclusion list
55
#find . -name '*.rs' -type f |sort >rustfmt_excluded_files
66

7+
# The +rustversion syntax only works with rustup-installed rust toolchains,
8+
# not with any distro-provided ones. Thus, we check for a rustup install and
9+
# only pass +1.63.0 if we find one.
10+
VERS=""
11+
[ "$(which rustup)" != "" ] && VERS="+1.63.0"
12+
713
# Run fmt
814
TMP_FILE=$(mktemp)
915
find . -name '*.rs' -type f |sort >$TMP_FILE
1016
for file in $(comm -23 $TMP_FILE rustfmt_excluded_files); do
1117
echo "Checking formatting of $file"
12-
rustfmt +1.63.0 --check $file
18+
rustfmt $VERS --check $file
1319
done

0 commit comments

Comments
 (0)