diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:02:58 +0000 |
commit | 698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch) | |
tree | 173a775858bd501c378080a10dca74132f05bc50 /src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh | |
parent | Initial commit. (diff) | |
download | rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip |
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rwxr-xr-x | src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh b/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh new file mode 100755 index 000000000..e9aa948eb --- /dev/null +++ b/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh @@ -0,0 +1,20 @@ +#!/bin/bash +# Checks that no error code explanation is removed. + +set -eo pipefail + +if [[ -z "$BASE_COMMIT" ]]; then + echo "not checking error code explanations removal" + exit 0 +fi + +echo "Check if an error code explanation was removed..." + +if (git diff "$BASE_COMMIT" --name-status | grep '^D' \ + | grep --quiet "compiler/rustc_error_codes/src/error_codes/"); then + echo "Error code explanations should never be removed!" + echo "Take a look at E0001 to see how to handle it." + exit 1 +fi + +echo "No error code explanation was removed!" |