Skip to content

Commit 35bc2af

Browse files
author
immersum
authored
Merge branch 'rust-lang:master' into master
2 parents f8a1266 + 49e2f37 commit 35bc2af

File tree

831 files changed

+19121
-6392
lines changed

Some content is hidden

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

831 files changed

+19121
-6392
lines changed

.cargo/config.toml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,10 @@ split-debuginfo = "unpacked"
2323
rustflags = ["--remap-path-prefix", "=clippy_dev"]
2424
[profile.dev.package.lintcheck]
2525
rustflags = ["--remap-path-prefix", "=lintcheck"]
26+
27+
# quine-mc_cluskey makes up a significant part of the runtime in dogfood
28+
# due to the number of conditions in the clippy_lints crate
29+
# and enabling optimizations for that specific dependency helps a bit
30+
# without increasing total build times.
31+
[profile.dev.package.quine-mc_cluskey]
32+
opt-level = 3

.github/ISSUE_TEMPLATE/new_lint.yml

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: New lint suggestion
2-
description: Suggest a new Clippy lint.
2+
description: |
3+
Suggest a new Clippy lint (currently not accepting new lints)
4+
Check out the Clippy book for more information about the feature freeze.
35
labels: ["A-lint"]
46
body:
57
- type: markdown
@@ -46,3 +48,24 @@ body:
4648
```
4749
validations:
4850
required: true
51+
- type: textarea
52+
id: comparison
53+
attributes:
54+
label: Comparison with existing lints
55+
description: |
56+
What makes this lint different from any existing lints that are similar, and how are those differences useful?
57+
58+
You can [use this playground template to see what existing lints are triggered by the bad code][playground]
59+
(make sure to use "Tools > Clippy" and not "Build").
60+
You can also look through the list of [rustc's allowed-by-default lints][allowed-by-default],
61+
as those won't show up in the playground above.
62+
63+
[allowed-by-default]: https://doc.rust-lang.org/rustc/lints/listing/allowed-by-default.html
64+
65+
[playground]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&code=%23%21%5Bwarn%28clippy%3A%3Apedantic%29%5D%0A%23%21%5Bwarn%28clippy%3A%3Anursery%29%5D%0A%23%21%5Bwarn%28clippy%3A%3Arestriction%29%5D%0A%23%21%5Bwarn%28clippy%3A%3Aall%29%5D%0A%23%21%5Ballow%28clippy%3A%3Ablanket_clippy_restriction_lints%2C+reason+%3D+%22testing+to+see+if+any+restriction+lints+match+given+code%22%29%5D%0A%0A%2F%2F%21+Template+that+can+be+used+to+see+what+clippy+lints+a+given+piece+of+code+would+trigger
66+
placeholder: Unlike `clippy::...`, the proposed lint would...
67+
- type: textarea
68+
id: context
69+
attributes:
70+
label: Additional Context
71+
description: Any additional context that you believe may be relevant.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,10 @@ order to get feedback.
3232

3333
Delete this line and everything above before opening your PR.
3434

35+
Note that we are currently not taking in new PRs that add new lints. We are in a
36+
feature freeze. Check out the book for more information. If you open a
37+
feature-adding pull request, its review will be delayed.
38+
3539
---
3640

3741
*Please write a short comment explaining your change (or "none" for internal only changes)*

.github/driver.sh

Lines changed: 3 additions & 3 deletions
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/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
50+
./target/debug/clippy-driver -Dwarnings -Aunused -Zui-testing --emit metadata --crate-type bin tests/ui/char_lit_as_u8.rs 2>char_lit_as_u8.stderr && exit 1
51+
sed -e "/= help: for/d" char_lit_as_u8.stderr > normalized.stderr
52+
diff -u normalized.stderr tests/ui/char_lit_as_u8.stderr
5353

5454
# make sure "clippy-driver --rustc --arg" and "rustc --arg" behave the same
5555
SYSROOT=$(rustc --print sysroot)

.github/workflows/clippy_dev.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
steps:
1717
# Setup
1818
- name: Checkout
19-
uses: actions/checkout@v4
19+
uses: actions/checkout@v5
2020
with:
2121
# Unsetting this would make so that any malicious package could get our Github Token
2222
persist-credentials: false

.github/workflows/clippy_mq.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
steps:
3737
# Setup
3838
- name: Checkout
39-
uses: actions/checkout@v4
39+
uses: actions/checkout@v5
4040
with:
4141
persist-credentials: false
4242

@@ -96,7 +96,7 @@ jobs:
9696
steps:
9797
# Setup
9898
- name: Checkout
99-
uses: actions/checkout@v4
99+
uses: actions/checkout@v5
100100
with:
101101
persist-credentials: false
102102

@@ -114,7 +114,7 @@ jobs:
114114
steps:
115115
# Setup
116116
- name: Checkout
117-
uses: actions/checkout@v4
117+
uses: actions/checkout@v5
118118
with:
119119
persist-credentials: false
120120

@@ -170,7 +170,7 @@ jobs:
170170
steps:
171171
# Setup
172172
- name: Checkout
173-
uses: actions/checkout@v4
173+
uses: actions/checkout@v5
174174
with:
175175
persist-credentials: false
176176

.github/workflows/clippy_pr.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424
steps:
2525
# Setup
2626
- name: Checkout
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828
with:
2929
# Unsetting this would make so that any malicious package could get our Github Token
3030
persist-credentials: false

.github/workflows/deploy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@ jobs:
2525
steps:
2626
# Setup
2727
- name: Checkout
28-
uses: actions/checkout@v4
28+
uses: actions/checkout@v5
2929
with:
3030
# Unsetting this would make so that any malicious package could get our Github Token
3131
persist-credentials: false
3232

3333
- name: Checkout
34-
uses: actions/checkout@v4
34+
uses: actions/checkout@v5
3535
with:
3636
ref: ${{ env.TARGET_BRANCH }}
3737
path: 'out'
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: Feature freeze check
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
branches:
8+
- master
9+
paths:
10+
- 'clippy_lints/src/declared_lints.rs'
11+
12+
jobs:
13+
auto-comment:
14+
runs-on: ubuntu-latest
15+
16+
permissions:
17+
pull-requests: write
18+
19+
# Do not in any case add code that runs anything coming from the content
20+
# of the pull request, as malicious code would be able to access the private
21+
# GitHub token.
22+
steps:
23+
- name: Add freeze warning comment
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
GITHUB_REPOSITORY: ${{ github.repository }}
27+
PR_NUMBER: ${{ github.event.pull_request.number }}
28+
run: |
29+
COMMENT=$(echo "**Seems that you are trying to add a new lint!**\n\
30+
\n\
31+
We are currently in a [feature freeze](https://doc.rust-lang.org/nightly/clippy/development/feature_freeze.html), so we are delaying all lint-adding PRs to September 18 and [focusing on bugfixes](https://github.com/rust-lang/rust-clippy/issues/15086).\n\
32+
\n\
33+
Thanks a lot for your contribution, and sorry for the inconvenience.\n\
34+
\n\
35+
With ❤ from the Clippy team.\n\
36+
\n\
37+
@rustbot note Feature-freeze\n\
38+
@rustbot blocked\n\
39+
@rustbot label +A-lint"
40+
)
41+
curl -s -H "Authorization: Bearer $GITHUB_TOKEN" \
42+
-H "Content-Type: application/vnd.github.raw+json" \
43+
-X POST \
44+
--data "{\"body\":\"${COMMENT}\"}" \
45+
"https://api.github.com/repos/${GITHUB_REPOSITORY}/issues/${PR_NUMBER}/comments"

.github/workflows/lintcheck.yml

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ jobs:
2424

2525
steps:
2626
- name: Checkout
27-
uses: actions/checkout@v4
27+
uses: actions/checkout@v5
2828
with:
2929
fetch-depth: 2
3030
# Unsetting this would make so that any malicious package could get our Github Token
@@ -80,7 +80,7 @@ jobs:
8080

8181
steps:
8282
- name: Checkout
83-
uses: actions/checkout@v4
83+
uses: actions/checkout@v5
8484
with:
8585
# Unsetting this would make so that any malicious package could get our Github Token
8686
persist-credentials: false
@@ -113,7 +113,7 @@ jobs:
113113

114114
steps:
115115
- name: Checkout
116-
uses: actions/checkout@v4
116+
uses: actions/checkout@v5
117117
with:
118118
# Unsetting this would make so that any malicious package could get our Github Token
119119
persist-credentials: false
@@ -128,21 +128,27 @@ jobs:
128128
- name: Download JSON
129129
uses: actions/download-artifact@v4
130130

131+
- name: Store PR number
132+
run: echo ${{ github.event.pull_request.number }} > pr.txt
133+
131134
- name: Diff results
132-
# GH's summery has a maximum size of 1024k:
133-
# https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary
134-
# That's why we first log to file and then to the summary and logs
135+
# GH's summery has a maximum size of 1MiB:
136+
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/workflow-commands-for-github-actions#step-isolation-and-limits
137+
# We upload the full diff as an artifact in case it's truncated
135138
run: |
136-
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --truncate >> truncated_diff.md
137-
head -c 1024000 truncated_diff.md >> $GITHUB_STEP_SUMMARY
138-
cat truncated_diff.md
139-
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json >> full_diff.md
139+
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --truncate | head -c 1M > $GITHUB_STEP_SUMMARY
140+
./target/debug/lintcheck diff {base,head}/ci_crates_logs.json --write-summary summary.json > full_diff.md
140141
141142
- name: Upload full diff
142143
uses: actions/upload-artifact@v4
143144
with:
144-
name: diff
145-
if-no-files-found: ignore
145+
name: full_diff
146+
path: full_diff.md
147+
148+
- name: Upload summary
149+
uses: actions/upload-artifact@v4
150+
with:
151+
name: summary
146152
path: |
147-
full_diff.md
148-
truncated_diff.md
153+
summary.json
154+
pr.txt

0 commit comments

Comments
 (0)