Skip to content

Commit 7a68957

Browse files
authored
Merge branch 'rust-lang:master' into chore/fix-manual-assert
2 parents e146ead + d79f862 commit 7a68957

File tree

675 files changed

+13494
-3552
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

675 files changed

+13494
-3552
lines changed

.github/deploy.sh

+2
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ if [[ -n $TAG_NAME ]]; then
4545
git add "$TAG_NAME"
4646
# Update the symlink
4747
git add stable
48+
# Update the index.html file
49+
git add index.html
4850
git commit -m "Add documentation for ${TAG_NAME} release: ${SHA}"
4951
elif [[ $BETA = "true" ]]; then
5052
if git diff --exit-code --quiet -- beta/; then

.github/driver.sh

+3-3
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ unset CARGO_MANIFEST_DIR
4747

4848
# Run a lint and make sure it produces the expected output. It's also expected to exit with code 1
4949
# FIXME: How to match the clippy invocation in compile-test.rs?
50-
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/double_neg.rs 2>double_neg.stderr && exit 1
51-
sed -e "/= help: for/d" double_neg.stderr > normalized.stderr
52-
diff -u normalized.stderr tests/ui/double_neg.stderr
50+
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/string_to_string.rs 2>string_to_string.stderr && exit 1
51+
sed -e "/= help: for/d" string_to_string.stderr > normalized.stderr
52+
diff -u normalized.stderr tests/ui/string_to_string.stderr
5353

5454
# make sure "clippy-driver --rustc --arg" and "rustc --arg" behave the same
5555
SYSROOT=$(rustc --print sysroot)
+59
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Clippy changelog check
2+
3+
on:
4+
merge_group:
5+
pull_request:
6+
types: [opened, reopened, synchronize, edited]
7+
8+
concurrency:
9+
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
10+
# If the push is not attached to a PR, we will cancel all builds on the same branch.
11+
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
12+
cancel-in-progress: true
13+
14+
jobs:
15+
changelog:
16+
runs-on: ubuntu-latest
17+
18+
defaults:
19+
run:
20+
shell: bash
21+
22+
steps:
23+
# Run
24+
- name: Check Changelog
25+
if: ${{ github.event_name == 'pull_request' }}
26+
run: |
27+
body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR_NUMBER" | \
28+
python -c "import sys, json; print(json.load(sys.stdin)['body'])")
29+
output=$(awk '/^changelog:\s*\S/ && !/changelog: \[.*\]: your change/' <<< "$body" | sed "s/changelog:\s*//g")
30+
if [ -z "$output" ]; then
31+
echo "ERROR: pull request message must contain 'changelog: ...' with your changelog. Please add it."
32+
exit 1
33+
else
34+
echo "changelog: $output"
35+
fi
36+
env:
37+
PYTHONIOENCODING: 'utf-8'
38+
PR_NUMBER: '${{ github.event.number }}'
39+
40+
# We need to have the "conclusion" job also on PR CI, to make it possible
41+
# to add PRs to a merge queue.
42+
conclusion_changelog:
43+
needs: [ changelog ]
44+
# We need to ensure this job does *not* get skipped if its dependencies fail,
45+
# because a skipped job is considered a success by GitHub. So we have to
46+
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
47+
# when the workflow is canceled manually.
48+
#
49+
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
50+
if: ${{ !cancelled() }}
51+
runs-on: ubuntu-latest
52+
steps:
53+
# Manually check the status of all dependencies. `if: failure()` does not work.
54+
- name: Conclusion
55+
run: |
56+
# Print the dependent jobs to see them in the CI log
57+
jq -C <<< '${{ toJson(needs) }}'
58+
# Check if all jobs that we depend on (in the needs array) were successful.
59+
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'

.github/workflows/clippy_dev.yml

+3
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ jobs:
1717
# Setup
1818
- name: Checkout
1919
uses: actions/checkout@v4
20+
with:
21+
# Unsetting this would make so that any malicious package could get our Github Token
22+
persist-credentials: false
2023

2124
# Run
2225
- name: Build

.github/workflows/clippy_mq.yml

+21-36
Original file line numberDiff line numberDiff line change
@@ -15,35 +15,7 @@ defaults:
1515
shell: bash
1616

1717
jobs:
18-
changelog:
19-
runs-on: ubuntu-latest
20-
21-
steps:
22-
- name: Checkout
23-
uses: actions/checkout@v4
24-
with:
25-
ref: ${{ github.ref }}
26-
27-
# Run
28-
- name: Check Changelog
29-
run: |
30-
MESSAGE=$(git log --format=%B -n 1)
31-
PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//')
32-
body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
33-
python -c "import sys, json; print(json.load(sys.stdin)['body'])")
34-
output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || {
35-
echo "ERROR: PR body must contain 'changelog: ...'"
36-
exit 1
37-
}
38-
if [[ "$output" = "none" ]]; then
39-
echo "WARNING: changelog is 'none'"
40-
else
41-
echo "changelog: $output"
42-
fi
43-
env:
44-
PYTHONIOENCODING: 'utf-8'
4518
base:
46-
needs: changelog
4719
strategy:
4820
matrix:
4921
include:
@@ -63,6 +35,8 @@ jobs:
6335
# Setup
6436
- name: Checkout
6537
uses: actions/checkout@v4
38+
with:
39+
persist-credentials: false
6640

6741
- name: Install i686 dependencies
6842
if: matrix.host == 'i686-unknown-linux-gnu'
@@ -74,7 +48,8 @@ jobs:
7448
- name: Install toolchain
7549
run: |
7650
rustup set default-host ${{ matrix.host }}
77-
rustup show active-toolchain
51+
# Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
52+
rustup show active-toolchain || rustup toolchain install
7853
7954
# Run
8055
- name: Build
@@ -114,31 +89,37 @@ jobs:
11489
OS: ${{ runner.os }}
11590

11691
metadata_collection:
117-
needs: changelog
11892
runs-on: ubuntu-latest
11993

12094
steps:
12195
# Setup
12296
- name: Checkout
12397
uses: actions/checkout@v4
98+
with:
99+
persist-credentials: false
124100

125101
- name: Install toolchain
126-
run: rustup show active-toolchain
102+
run: |
103+
# Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
104+
rustup show active-toolchain || rustup toolchain install
127105
128106
- name: Test metadata collection
129107
run: cargo collect-metadata
130108

131109
integration_build:
132-
needs: changelog
133110
runs-on: ubuntu-latest
134111

135112
steps:
136113
# Setup
137114
- name: Checkout
138115
uses: actions/checkout@v4
116+
with:
117+
persist-credentials: false
139118

140119
- name: Install toolchain
141-
run: rustup show active-toolchain
120+
run: |
121+
# Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
122+
rustup show active-toolchain || rustup toolchain install
142123
143124
# Run
144125
- name: Build Integration Test
@@ -188,9 +169,13 @@ jobs:
188169
# Setup
189170
- name: Checkout
190171
uses: actions/checkout@v4
172+
with:
173+
persist-credentials: false
191174

192175
- name: Install toolchain
193-
run: rustup show active-toolchain
176+
run: |
177+
# Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
178+
rustup show active-toolchain || rustup toolchain install
194179
195180
# Download
196181
- name: Download target dir
@@ -205,13 +190,13 @@ jobs:
205190
# Run
206191
- name: Test ${{ matrix.integration }}
207192
run: |
208-
TOOLCHAIN=$(rustup show active-toolchain | cut -f1 -d' ')
193+
TOOLCHAIN=$(rustup show active-toolchain | head -n 1 | cut -f1 -d' ')
209194
rustup run $TOOLCHAIN $CARGO_TARGET_DIR/debug/integration --show-output
210195
env:
211196
INTEGRATION: ${{ matrix.integration }}
212197

213198
conclusion:
214-
needs: [ changelog, base, metadata_collection, integration_build, integration ]
199+
needs: [ base, metadata_collection, integration_build, integration ]
215200
# We need to ensure this job does *not* get skipped if its dependencies fail,
216201
# because a skipped job is considered a success by GitHub. So we have to
217202
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run

.github/workflows/clippy_pr.yml

+6-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,14 @@ jobs:
2525
# Setup
2626
- name: Checkout
2727
uses: actions/checkout@v4
28+
with:
29+
# Unsetting this would make so that any malicious package could get our Github Token
30+
persist-credentials: false
2831

2932
- name: Install toolchain
30-
run: rustup show active-toolchain
33+
run: |
34+
# Use a way compatible with Rustup pre-1.28.0 and Rustup 1.28.0
35+
rustup show active-toolchain || rustup toolchain install
3136
3237
# Run
3338
- name: Build

.github/workflows/deploy.yml

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,19 +22,27 @@ jobs:
2222
# Setup
2323
- name: Checkout
2424
uses: actions/checkout@v4
25+
with:
26+
# Unsetting this would make so that any malicious package could get our Github Token
27+
persist-credentials: false
2528

2629
- name: Checkout
2730
uses: actions/checkout@v4
2831
with:
2932
ref: ${{ env.TARGET_BRANCH }}
3033
path: 'out'
34+
# Unsetting this would make so that any malicious package could get our Github Token
35+
persist-credentials: false
3136

3237
# Run
3338
- name: Set tag name
3439
if: startswith(github.ref, 'refs/tags/')
3540
run: |
36-
TAG=$(basename ${{ github.ref }})
41+
TAG=$(basename "${TAGNAME}")
3742
echo "TAG_NAME=$TAG" >> $GITHUB_ENV
43+
env:
44+
# Make sure that the reference gets expanded before injecting it
45+
TAGNAME: ${{ github.ref }}
3846
- name: Set beta to true
3947
if: github.ref == 'refs/heads/beta'
4048
run: echo "BETA=true" >> $GITHUB_ENV

.github/workflows/lintcheck.yml

+15-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Lintcheck
22

3-
on: pull_request
3+
on:
4+
pull_request:
5+
paths-ignore:
6+
- 'book/**'
7+
- 'util/**'
8+
- 'tests/**'
9+
- '*.md'
410

511
env:
612
RUST_BACKTRACE: 1
@@ -21,6 +27,8 @@ jobs:
2127
uses: actions/checkout@v4
2228
with:
2329
fetch-depth: 2
30+
# Unsetting this would make so that any malicious package could get our Github Token
31+
persist-credentials: false
2432

2533
# HEAD is the generated merge commit `refs/pull/N/merge` between the PR and `master`, `HEAD^`
2634
# being the commit from `master` that is the base of the merge
@@ -73,6 +81,9 @@ jobs:
7381
steps:
7482
- name: Checkout
7583
uses: actions/checkout@v4
84+
with:
85+
# Unsetting this would make so that any malicious package could get our Github Token
86+
persist-credentials: false
7687

7788
- name: Cache lintcheck bin
7889
id: cache-lintcheck-bin
@@ -103,6 +114,9 @@ jobs:
103114
steps:
104115
- name: Checkout
105116
uses: actions/checkout@v4
117+
with:
118+
# Unsetting this would make so that any malicious package could get our Github Token
119+
persist-credentials: false
106120

107121
- name: Restore lintcheck bin
108122
uses: actions/cache/restore@v4

.github/workflows/remark.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
# Setup
1313
- name: Checkout
1414
uses: actions/checkout@v4
15+
with:
16+
# Unsetting this would make so that any malicious package could get our Github Token
17+
persist-credentials: false
1518

1619
- name: Setup Node.js
1720
uses: actions/setup-node@v4
@@ -24,7 +27,7 @@ jobs:
2427
- name: Install mdbook
2528
run: |
2629
mkdir mdbook
27-
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.34/mdbook-v0.4.34-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
30+
curl -Lf https://github.com/rust-lang/mdBook/releases/download/v0.4.43/mdbook-v0.4.43-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook
2831
echo `pwd`/mdbook >> $GITHUB_PATH
2932
3033
# Run

0 commit comments

Comments
 (0)