File tree 3 files changed +22
-0
lines changed
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/
28
28
RUN sh /scripts/sccache.sh
29
29
30
30
COPY host-x86_64/mingw-check/validate-toolstate.sh /scripts/
31
+ COPY host-x86_64/mingw-check/validate-error-codes.sh /scripts/
31
32
32
33
ENV RUN_CHECK_WITH_PARALLEL_QUERIES 1
33
34
ENV 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 && \
37
38
python3 ../x.py test --stage 2 src/tools/tidy && \
38
39
python3 ../x.py doc --stage 0 library/test && \
39
40
/scripts/validate-toolstate.sh && \
41
+ /scripts/validate-error-codes.sh && \
40
42
# Runs checks to ensure that there are no ES5 issues in our JS code.
41
43
es-check es5 ../src/librustdoc/html/static/*.js && \
42
44
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
219
219
command=" /checkout/src/ci/run.sh"
220
220
fi
221
221
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
+
222
226
docker \
223
227
run \
224
228
--workdir /checkout/obj \
@@ -237,6 +241,7 @@ docker \
237
241
--env TOOLSTATE_PUBLISH \
238
242
--env RUST_CI_OVERRIDE_RELEASE_CHANNEL \
239
243
--env CI_JOB_NAME=" ${CI_JOB_NAME-$IMAGE } " \
244
+ --env BASE_COMMIT=" $BASE_COMMIT " \
240
245
--init \
241
246
--rm \
242
247
rust-ci \
You can’t perform that action at this time.
0 commit comments