summaryrefslogtreecommitdiffstats
path: root/src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh
diff options
context:
space:
mode:
Diffstat (limited to 'src/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh')
-rwxr-xr-xsrc/ci/docker/host-x86_64/mingw-check/validate-error-codes.sh20
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!"