diff options
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!" |