File tree Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Expand file tree Collapse file tree 3 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ COPY scripts/sccache.sh /scripts/
2828RUN sh /scripts/sccache.sh
2929
3030COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
31+ COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
3132
3233ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
3334ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
@@ -37,6 +38,7 @@ ENV SCRIPT python3 ../x.py --stage 2 test src/tools/expand-yaml-anchors && \
3738 python3 ../x.py test --stage 2 src/tools/tidy && \
3839 python3 ../x.py doc --stage 0 library/test && \
3940 /scripts/validate-toolstate.sh && \
41+ /scripts/validate-error-codes.sh && \
4042 # Runs checks to ensure that there are no ES5 issues in our JS code.
4143 es-check es5 ../src/librustdoc/html/static/*.js && \
4244 eslint ../src/librustdoc/html/static/*.js
Original file line number Diff line number Diff line change 1+ #! /bin/bash
2+ # Checks that no error code explanation is removed.
3+
4+ set -euo pipefail
5+
6+ echo " Check if an error code explanation was removed..."
7+
8+ if (git diff " $BASE_COMMIT " --name-status | grep ' ^D' \
9+ | grep --quiet " compiler/rustc_error_codes/src/error_codes/" ); then
10+ echo " Error code explanations should never be removed!"
11+ echo " Take a look at E0001 to see how to handle it."
12+ exit 1
13+ fi
14+
15+ echo " No error code explanation was removed!"
Original file line number Diff line number Diff line change @@ -219,6 +219,10 @@ else
219219 command=" /checkout/src/ci/run.sh"
220220fi
221221
222+ # Get some needed information for $BASE_COMMIT
223+ git fetch " https://github.com/$GITHUB_REPOSITORY " " $GITHUB_BASE_REF "
224+ BASE_COMMIT=" $( git merge-base FETCH_HEAD HEAD) "
225+
222226docker \
223227 run \
224228 --workdir /checkout/obj \
@@ -237,6 +241,7 @@ docker \
237241 --env TOOLSTATE_PUBLISH \
238242 --env RUST_CI_OVERRIDE_RELEASE_CHANNEL \
239243 --env CI_JOB_NAME=" ${CI_JOB_NAME-$IMAGE } " \
244+ --env BASE_COMMIT=" $BASE_COMMIT " \
240245 --init \
241246 --rm \
242247 rust-ci \
You can’t perform that action at this time.
0 commit comments