Skip to content

Clippy subtree update #136209

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 166 commits into from
Jan 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
166 commits
Select commit Hold shift + click to select a range
52abb8f
Add new lint `unneeded_struct_pattern`
SpriteOvO Sep 26, 2024
08d8c4a
don't suggest to use cloned for Cow in unnecessary_to_owned
lapla-cogito Dec 19, 2024
8275f42
add more test coverage for #11230
matthiaskrgr Dec 31, 2024
a7c2e4d
Fix link to release tags
alex-semenyuk Jan 2, 2025
05cb1ce
Fix not found links at Book
alex-semenyuk Jan 3, 2025
39269aa
auto-fix slow_vector_initialization
lapla-cogito Jan 5, 2025
c9315bc
Use diagnostic item instead of path for `core::fmt::Debug`
samueltardieu Jan 5, 2025
e0625f4
fix(adding_lints): usage of early vs late lint pass
aaron-ang Jan 6, 2025
16ee014
Update adding_lints.md
aaron-ang Jan 7, 2025
f1d9090
define_clippy_lints does not exist, declare_clippy_lints exists
lapla-cogito Jan 7, 2025
9ad75b3
Update tests.
m-ou-se Oct 31, 2024
28d2363
Exhaustively handle expressions in patterns
oli-obk Dec 11, 2024
0faf8c7
Rename PatKind::Lit to Expr
oli-obk Jan 7, 2025
c686ffd
Do not propose to elide lifetimes if this causes an ambiguity
samueltardieu Jan 2, 2025
55c8550
Also deploy index.html file on release
flip1995 Jan 9, 2025
e42e354
Remove needless check of returned type
qsantos Jan 9, 2025
d5264c7
Check for needless uses of str::bytes()
qsantos Jan 9, 2025
d0a74af
Merge commit '19e305bb57a7595f2a8d81f521c0dd8bf854e739' into clippy-s…
flip1995 Jan 9, 2025
db4aac6
Correct version of `literal_string_with_formatting_args`
kpreid Jan 9, 2025
197d58d
Improve `needless_as_bytes` to also detect `str::bytes()` (#13972)
llogiq Jan 9, 2025
d8301d7
Do not intersect spans coming from different contexts
samueltardieu Jan 4, 2025
5c2601a
Do not propose to elide lifetimes if this causes an ambiguity (#13929)
xFrednet Jan 10, 2025
716a3a4
Do not intersect spans coming from different contexts (#13942)
dswij Jan 10, 2025
f3b1dd6
Fix labels
alex-semenyuk Jan 10, 2025
7611dbb
Mention existing labels at CONTRIBUTING (#13978)
blyxyas Jan 10, 2025
7639e82
CI: check the presence of the changelog line in every pull request
samueltardieu Jan 10, 2025
cccb006
CI: check the presence of the changelog line in every pull request (#…
flip1995 Jan 10, 2025
fc0e65d
Use diagnostic item instead of path for `core::fmt::Debug` (#13949)
flip1995 Jan 10, 2025
1bdee5b
CI: rerun the changelog check on PR synchronization
samueltardieu Jan 10, 2025
4a69d0d
New lint: manual_ok_err
samueltardieu Nov 27, 2024
8678f9c
CI: rerun the changelog check on PR synchronization (#13980)
flip1995 Jan 10, 2025
579571d
New lint: manual_ok_err (#13740)
blyxyas Jan 10, 2025
64250a3
Also deploy index.html file on release (#13971)
Centri3 Jan 10, 2025
ab55d3f
Correct version of `literal_string_with_formatting_args` (#13974)
Centri3 Jan 10, 2025
f5864d7
migrate `clippy` to the `DenseBitSet` name
lqd Jan 7, 2025
0b402ba
Do not look for significant drop inside `.await` expansion
samueltardieu Jan 11, 2025
a895beb
add more test coverage for #11230 (#13915)
y21 Jan 11, 2025
34d109f
Add new lint `unneeded_struct_pattern` (#13465)
Centri3 Jan 12, 2025
5f75715
Do not trigger `redundant_pub_crate` in external macros
samueltardieu Jan 6, 2025
d648cc9
Do not trigger `redundant_pub_crate` in external macros (#13952)
Centri3 Jan 12, 2025
8f257c7
don't suggest to use `cloned` for `Cow` in `unnecessary_to_owned` (#1…
y21 Jan 12, 2025
23f1ebe
Fix macro name in the Book (#13958)
flip1995 Jan 13, 2025
2d8a3e8
Fix not found links at Book (#13935)
flip1995 Jan 13, 2025
dc99034
Fix link to release tags (#13930)
flip1995 Jan 13, 2025
0db6411
fix(adding_lints): usage of early vs late lint pass (#13955)
flip1995 Jan 13, 2025
a731668
In edition 2024, `std::env::set_var` is `unsafe`
samueltardieu Jan 13, 2025
0456e4d
In edition 2024, `gen` is a reserved keyword
samueltardieu Jan 13, 2025
dcbe3ad
auto-fix `slow_vector_initialization` in some cases (#13947)
blyxyas Jan 13, 2025
6c367cb
Update mdbook to 0.4.43
samueltardieu Jan 13, 2025
a4805ff
Select edition 2024
samueltardieu Jan 10, 2025
6ab6c3c
Select Rust edition 2024 for compiling Clippy (#13751)
flip1995 Jan 13, 2025
dc23fa5
Suggest `manual_div_ceil` even when right operand is a constant
samueltardieu Jan 6, 2025
8b7cfc7
Rust 1.81 and later support elision with explicit self types
samueltardieu Jan 13, 2025
35dbaf8
New lint `useless-nonzero-new_unchecked`
samueltardieu Jan 13, 2025
8c1ea9f
Do not look for significant drop inside `.await` expansion (#13985)
dswij Jan 14, 2025
44560cb
Add hir::HeaderSafety to make follow up commits simpler
oli-obk Dec 13, 2024
7e83ec5
Suggest `manual_div_ceil` even when right operand is a constant (#13951)
blyxyas Jan 14, 2025
98761e4
Rust 1.81 and later support elision with explicit self types (#13992)
Alexendoo Jan 14, 2025
25d319d
New lint `useless-nonzero-new_unchecked` (#13993)
Manishearth Jan 15, 2025
544f71f
add `manual_repeat_n` lint
lapla-cogito Dec 20, 2024
9a1bbe9
use `repeat_n()` where available
lapla-cogito Dec 20, 2024
321d21f
allowed_through_unstable_modules: support showing a deprecation messa…
RalfJung Jan 1, 2025
caebd67
intrinsics: deprecate calling them via the unstable std::intrinsics path
RalfJung Jan 1, 2025
1361c1f
Rollup merge of #132397 - m-ou-se:warn-missing-abi, r=Nadrieril
jhpratt Jan 15, 2025
f6df266
Auto merge of #134353 - oli-obk:safe-target-feature-unsafe-by-default…
bors Jan 15, 2025
e31493b
Rollup merge of #135003 - RalfJung:deprecate-allowed-through-unstable…
GuillaumeGomez Jan 15, 2025
7485970
Pause assignments for @xFrednet
xFrednet Jan 15, 2025
8d0c0eb
Pause assignments for @xFrednet (#14005)
xFrednet Jan 15, 2025
ded9354
Suggest using `Vec::extend()` in `same_item_push`
samueltardieu Jan 11, 2025
ee522d8
change literal_string_with_formatting_args lint to pedantic
anatawa12 Jan 17, 2025
e307b2f
fix version search in the website
lapla-cogito Jan 17, 2025
e359e88
fix version search in the website (#14016)
blyxyas Jan 17, 2025
23e602c
fix: correct suggestion for significant_drop_in_scrutinee in expressions
vishruth-thimmaiah Jan 17, 2025
3f4aa9b
Update doc wildcard_dependencies
alex-semenyuk Dec 11, 2024
10045db
Update doc wildcard_dependencies (#13810)
llogiq Jan 17, 2025
f327640
Emit `missing_const_for_fn` for `CONST_MUT_REFS`
tomcur Dec 16, 2024
a487c60
Fix typo in `check_clousure` function name
samueltardieu Jan 18, 2025
38828bf
Fix typo in `check_clousure` function name (#14025)
y21 Jan 18, 2025
2220806
Emit `missing_const_for_fn` for `CONST_MUT_REFS` (#13839)
Alexendoo Jan 18, 2025
e7f1e42
Revert "Auto merge of #134330 - scottmcm:no-more-rvalue-len, r=matthe…
lqd Jan 18, 2025
fbf6631
chore: change to nursery instead
anatawa12 Jan 19, 2025
7f37b2a
Use clearer multipart suggestions for `unnecessary_map_or` lint
samueltardieu Jan 13, 2025
27592e3
Make `unnecessary_map_or` work with ref and `Deref`
samueltardieu Jan 18, 2025
e692cd4
change `literal_string_with_formatting_args` lint category to nursery…
Alexendoo Jan 19, 2025
51b0107
New lint: `unnecessary_semicolon`
samueltardieu Sep 18, 2024
3a7f50f
Apply `unnecessary_semicolon` to Clippy sources
samueltardieu Jan 19, 2025
1ccef58
`useless_conversion`: add needed adjustments to suggestion
samueltardieu Jan 19, 2025
0707fe8
add a new lint for `repeat().take()` that can be replaced with `repea…
y21 Jan 19, 2025
2280b8a
Use clearer multipart suggestions for `unnecessary_map_or` lint (#13998)
y21 Jan 19, 2025
2b488c3
Get rid of mir::Const::from_ty_const
compiler-errors Jan 20, 2025
01907f7
`useless_conversion`: use multipart suggestion to make adjustments mo…
samueltardieu Jan 19, 2025
eff57e2
Fix out-of-date comment
samueltardieu Jan 20, 2025
8f1b4bb
New lint: `unnecessary_semicolon` (#14032)
llogiq Jan 20, 2025
0c3deeb
`match_bool`: omit suggestion if guard is present
samueltardieu Jan 20, 2025
d1b5fa2
fix: correct suggestion for significant_drop_in_scrutinee in expressi…
y21 Jan 21, 2025
7f162fa
`short_circuit_statement`: handle macros and parenthesis better
samueltardieu Jan 20, 2025
759212c
remove support for the #[start] attribute
RalfJung Dec 14, 2024
699296d
Move supertrait_def_ids into the elaborate module like all other fns
compiler-errors Jan 18, 2025
d22dcb9
Auto merge of #134299 - RalfJung:remove-start, r=compiler-errors
bors Jan 21, 2025
de12d28
Rollup merge of #135706 - compiler-errors:elaborate, r=lcnr
matthiaskrgr Jan 21, 2025
a18b75a
docs: fix verbose-bit-mask example
jwong101 Jan 22, 2025
26838f8
don't trigger `needless_late_init` when the first usage is in macro
lapla-cogito Jan 21, 2025
396de57
don't trigger `needless_late_init` when the first usage is in macro (…
y21 Jan 22, 2025
88d83b6
`short_circuit_statement`: handle macros and parenthesis better (#14047)
y21 Jan 22, 2025
71ba2cf
Extract `leaks_droppable_temporary_with_limited_lifetime()`
samueltardieu Jan 22, 2025
9dca770
`unnecessary_semicolon`: do not lint if it may cause borrow errors
samueltardieu Jan 20, 2025
67e6bf3
Suggest using `Vec::extend()` in `same_item_push` (#13987)
xFrednet Jan 22, 2025
c024c13
`unnecessary_semicolon`: do not lint if it may cause borrow errors (#…
y21 Jan 22, 2025
106db26
`match_bool`: fix suggestion if guard is present (#14039)
llogiq Jan 22, 2025
69ff46e
`arithmetic_side_effects`: check adjusted expression types
samueltardieu Jan 22, 2025
3254f02
`arithmetic_side_effects`: check adjusted expression types (#14062)
Manishearth Jan 22, 2025
2c8d1ae
Fix out-of-date comment (#14040)
Centri3 Jan 22, 2025
5c4e940
Make `hir::TyKind::TraitObject` use tagged ptr
BoxyUwU Jan 10, 2025
109440b
The clipper :3c
BoxyUwU Jan 10, 2025
6ed9588
`visit_x_unambig`
BoxyUwU Jan 18, 2025
3309f02
make `hir::Ty/ConstArg` methods generic where applicable
BoxyUwU Jan 19, 2025
2f2d09a
clarify message for non-obvious precedence
jhpratt Jan 20, 2025
92fac5c
clarify message for non-obvious precedence (#14043)
Centri3 Jan 23, 2025
1da4eb3
Remove the need to manually call set_using_internal_features
bjorn3 Jan 22, 2025
d7b3940
Remove RunCompiler
bjorn3 Jan 22, 2025
4b05f50
Add necessary adjustments to suggestion to remove redundant `.into_it…
y21 Jan 23, 2025
a855136
set default changelog messages to fail the changelog CI
lapla-cogito Jan 24, 2025
6180622
Auto merge of #135272 - BoxyUwU:generic_arg_infer_reliability_2, r=co…
bors Jan 24, 2025
d7e20a9
docs: fix verbose-bit-mask example (#14055)
Alexendoo Jan 24, 2025
2671e4a
add new lint `non_std_lazy_statics`
J-ZhengLi Jun 24, 2024
4825666
add new lint `non_std_lazy_statics` (#13770)
llogiq Jan 25, 2025
db97768
trigger `obfuscated_if_else` for `.then(..).unwrap_or(..)`
lapla-cogito Jan 18, 2025
d8752db
New lint
wowinter13 Jan 15, 2025
c214f51
Update CHANGELOG.md
wowinter13 Jan 15, 2025
2ad20da
Rollback CHANGELOG.md change
wowinter13 Jan 15, 2025
307d854
Address linter & changelog issues
wowinter13 Jan 15, 2025
7124d82
Fix function signature
wowinter13 Jan 15, 2025
43066fe
Fix related test
wowinter13 Jan 15, 2025
9e83183
uibless for tests
wowinter13 Jan 15, 2025
26a7b32
Rename slice_as_bytes -> sliced_string_as_bytes
wowinter13 Jan 15, 2025
4fef1b4
Fix tests
wowinter13 Jan 15, 2025
5855e0a
Small refactoring: irrefutable let pattern
wowinter13 Jan 16, 2025
4e94d22
nit: change placeholders
wowinter13 Jan 16, 2025
beeb6f7
slice-as-bytes: pedantic -> perf
wowinter13 Jan 25, 2025
9135923
trigger `obfuscated_if_else` for `.then(..).unwrap_or(..)` (#14021)
llogiq Jan 25, 2025
2640f65
change the applicability of `obfuscated_if_else` depending on whether…
lapla-cogito Jan 22, 2025
ba78c22
Remove "Known problems" section for `borrow_interior_mutable_const`
alex-semenyuk Jan 26, 2025
5006145
Auto merge of #135753 - compiler-errors:from-ty-const, r=oli-obk
bors Jan 26, 2025
25a77cf
remove `clippy::double_neg`
kadiwa4 Oct 29, 2024
e84d60d
set default PR messages to fail the changelog CI (#14069)
flip1995 Jan 26, 2025
057f5b3
Make `unnecessary_map_or` work with ref and `Deref` to `Option`/`Resu…
blyxyas Jan 26, 2025
0b818aa
fixed a missing description of the MSRV option for `manual_repeat_n`
lapla-cogito Jan 26, 2025
c26985b
fixed a missing description of the MSRV option for `manual_repeat_n` …
y21 Jan 26, 2025
c519673
Rollup merge of #126604 - kadiwa4:uplift_double_negation, r=nnethercote
fmease Jan 27, 2025
ac805d4
Remove "Known problems" section for `borrow_interior_mutable_const` (…
Manishearth Jan 27, 2025
85bbba6
New lint `sliced_string_as_bytes` (#14002)
Manishearth Jan 27, 2025
43b29da
correct suggestion for `redundant_closure` in a `no_std` environment
lapla-cogito Jan 14, 2025
e146039
correct suggestion for `repeat_vec_with_capacity` in a `no_std` envir…
lapla-cogito Jan 14, 2025
cb0a479
don't suggest to use `std::vec::Vec` for `single_range_in_vec_init` i…
lapla-cogito Jan 14, 2025
d99eae4
correct suggestion for `drain_collect` in a `no_std` environment
lapla-cogito Jan 14, 2025
3b0b8b0
correct suggestion for `map_with_unused_argument_over_ranges` in a `n…
lapla-cogito Jan 14, 2025
83bde36
correct suggestions in `no_std` (#13999)
Manishearth Jan 27, 2025
66dc8a1
proper applicability for `obfuscated_if_else` (#14061)
Centri3 Jan 28, 2025
4693d0a
Add new lint `doc_overindented_list_items`
ohno418 Jan 14, 2025
80c2d09
Add new lint `doc_overindented_list_items` (#13711)
Centri3 Jan 28, 2025
75b39d0
exclude specific directories from `Lintcheck`
lapla-cogito Jan 27, 2025
25509e7
exclude some directories from `Lintcheck` CI (#14084)
flip1995 Jan 28, 2025
145d5ad
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Jan 28, 2025
336a259
Bump nightly version -> 2025-01-28
flip1995 Jan 28, 2025
51d49c1
Rustup (#14080)
flip1995 Jan 28, 2025
4288227
Merge commit '51d49c1ae2785b24ef18a46ef233fc1d91844666' into clippy-s…
flip1995 Jan 28, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/tools/clippy/.github/deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ if [[ -n $TAG_NAME ]]; then
git add "$TAG_NAME"
# Update the symlink
git add stable
# Update the index.html file
git add index.html
git commit -m "Add documentation for ${TAG_NAME} release: ${SHA}"
elif [[ $BETA = "true" ]]; then
if git diff --exit-code --quiet -- beta/; then
Expand Down
6 changes: 3 additions & 3 deletions src/tools/clippy/.github/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ unset CARGO_MANIFEST_DIR

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

# make sure "clippy-driver --rustc --arg" and "rustc --arg" behave the same
SYSROOT=$(rustc --print sysroot)
Expand Down
59 changes: 59 additions & 0 deletions src/tools/clippy/.github/workflows/clippy_changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: Clippy changelog check

on:
merge_group:
pull_request:
types: [opened, reopened, synchronize, edited]

concurrency:
# For a given workflow, if we push to the same PR, cancel all previous builds on that PR.
# If the push is not attached to a PR, we will cancel all builds on the same branch.
group: "${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}"
cancel-in-progress: true

jobs:
changelog:
runs-on: ubuntu-latest

defaults:
run:
shell: bash

steps:
# Run
- name: Check Changelog
if: ${{ github.event_name == 'pull_request' }}
run: |
body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR_NUMBER" | \
python -c "import sys, json; print(json.load(sys.stdin)['body'])")
output=$(awk '/^changelog:\s*\S/ && !/changelog: \[.*\]: your change/' <<< "$body" | sed "s/changelog:\s*//g")
if [ -z "$output" ]; then
echo "ERROR: pull request message must contain 'changelog: ...' with your changelog. Please add it."
exit 1
else
echo "changelog: $output"
fi
env:
PYTHONIOENCODING: 'utf-8'
PR_NUMBER: '${{ github.event.number }}'

# We need to have the "conclusion" job also on PR CI, to make it possible
# to add PRs to a merge queue.
conclusion_changelog:
needs: [ changelog ]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
# when the workflow is canceled manually.
#
# ALL THE PREVIOUS JOBS NEED TO BE ADDED TO THE `needs` SECTION OF THIS JOB!
if: ${{ !cancelled() }}
runs-on: ubuntu-latest
steps:
# Manually check the status of all dependencies. `if: failure()` does not work.
- name: Conclusion
run: |
# Print the dependent jobs to see them in the CI log
jq -C <<< '${{ toJson(needs) }}'
# Check if all jobs that we depend on (in the needs array) were successful.
jq --exit-status 'all(.result == "success")' <<< '${{ toJson(needs) }}'
34 changes: 1 addition & 33 deletions src/tools/clippy/.github/workflows/clippy_mq.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,37 +15,7 @@ defaults:
shell: bash

jobs:
changelog:
runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ github.ref }}
# Unsetting this would make so that any malicious package could get our Github Token
persist-credentials: false

# Run
- name: Check Changelog
run: |
MESSAGE=$(git log --format=%B -n 1)
PR=$(echo "$MESSAGE" | grep -o "#[0-9]*" | head -1 | sed -e 's/^#//')
body=$(curl -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" -s "https://api.github.com/repos/rust-lang/rust-clippy/pulls/$PR" | \
python -c "import sys, json; print(json.load(sys.stdin)['body'])")
output=$(grep "^changelog:\s*\S" <<< "$body" | sed "s/changelog:\s*//g") || {
echo "ERROR: PR body must contain 'changelog: ...'"
exit 1
}
if [[ "$output" = "none" ]]; then
echo "WARNING: changelog is 'none'"
else
echo "changelog: $output"
fi
env:
PYTHONIOENCODING: 'utf-8'
base:
needs: changelog
strategy:
matrix:
include:
Expand Down Expand Up @@ -119,7 +89,6 @@ jobs:
OS: ${{ runner.os }}

metadata_collection:
needs: changelog
runs-on: ubuntu-latest

steps:
Expand All @@ -138,7 +107,6 @@ jobs:
run: cargo collect-metadata

integration_build:
needs: changelog
runs-on: ubuntu-latest

steps:
Expand Down Expand Up @@ -228,7 +196,7 @@ jobs:
INTEGRATION: ${{ matrix.integration }}

conclusion:
needs: [ changelog, base, metadata_collection, integration_build, integration ]
needs: [ base, metadata_collection, integration_build, integration ]
# We need to ensure this job does *not* get skipped if its dependencies fail,
# because a skipped job is considered a success by GitHub. So we have to
# overwrite `if:`. We use `!cancelled()` to ensure the job does still not get run
Expand Down
8 changes: 7 additions & 1 deletion src/tools/clippy/.github/workflows/lintcheck.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
name: Lintcheck

on: pull_request
on:
pull_request:
paths-ignore:
- 'book/**'
- 'util/**'
- 'tests/**'
- '*.md'

env:
RUST_BACKTRACE: 1
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/.github/workflows/remark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install mdbook
run: |
mkdir mdbook
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
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
echo `pwd`/mdbook >> $GITHUB_PATH

# Run
Expand Down
8 changes: 8 additions & 0 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5533,6 +5533,7 @@ Released 2018-09-13
[`doc_link_with_quotes`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_link_with_quotes
[`doc_markdown`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_markdown
[`doc_nested_refdefs`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_nested_refdefs
[`doc_overindented_list_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#doc_overindented_list_items
[`double_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#double_comparisons
[`double_ended_iterator_last`]: https://rust-lang.github.io/rust-clippy/master/index.html#double_ended_iterator_last
[`double_must_use`]: https://rust-lang.github.io/rust-clippy/master/index.html#double_must_use
Expand Down Expand Up @@ -5762,11 +5763,13 @@ Released 2018-09-13
[`manual_memcpy`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_memcpy
[`manual_next_back`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_next_back
[`manual_non_exhaustive`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_non_exhaustive
[`manual_ok_err`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_err
[`manual_ok_or`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_ok_or
[`manual_pattern_char_comparison`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_pattern_char_comparison
[`manual_range_contains`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_contains
[`manual_range_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_range_patterns
[`manual_rem_euclid`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_rem_euclid
[`manual_repeat_n`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_repeat_n
[`manual_retain`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_retain
[`manual_rotate`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_rotate
[`manual_saturating_arithmetic`]: https://rust-lang.github.io/rust-clippy/master/index.html#manual_saturating_arithmetic
Expand Down Expand Up @@ -5904,6 +5907,7 @@ Released 2018-09-13
[`non_minimal_cfg`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_minimal_cfg
[`non_octal_unix_permissions`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_octal_unix_permissions
[`non_send_fields_in_send_ty`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_send_fields_in_send_ty
[`non_std_lazy_statics`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_std_lazy_statics
[`non_zero_suggestions`]: https://rust-lang.github.io/rust-clippy/master/index.html#non_zero_suggestions
[`nonminimal_bool`]: https://rust-lang.github.io/rust-clippy/master/index.html#nonminimal_bool
[`nonsensical_open_options`]: https://rust-lang.github.io/rust-clippy/master/index.html#nonsensical_open_options
Expand Down Expand Up @@ -6063,6 +6067,7 @@ Released 2018-09-13
[`size_of_in_element_count`]: https://rust-lang.github.io/rust-clippy/master/index.html#size_of_in_element_count
[`size_of_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#size_of_ref
[`skip_while_next`]: https://rust-lang.github.io/rust-clippy/master/index.html#skip_while_next
[`sliced_string_as_bytes`]: https://rust-lang.github.io/rust-clippy/master/index.html#sliced_string_as_bytes
[`slow_vector_initialization`]: https://rust-lang.github.io/rust-clippy/master/index.html#slow_vector_initialization
[`stable_sort_primitive`]: https://rust-lang.github.io/rust-clippy/master/index.html#stable_sort_primitive
[`std_instead_of_alloc`]: https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_alloc
Expand Down Expand Up @@ -6172,12 +6177,14 @@ Released 2018-09-13
[`unnecessary_safety_comment`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_comment
[`unnecessary_safety_doc`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_safety_doc
[`unnecessary_self_imports`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_self_imports
[`unnecessary_semicolon`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_semicolon
[`unnecessary_sort_by`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_sort_by
[`unnecessary_struct_initialization`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_struct_initialization
[`unnecessary_to_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_to_owned
[`unnecessary_unwrap`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_unwrap
[`unnecessary_wraps`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnecessary_wraps
[`unneeded_field_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_field_pattern
[`unneeded_struct_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_struct_pattern
[`unneeded_wildcard_pattern`]: https://rust-lang.github.io/rust-clippy/master/index.html#unneeded_wildcard_pattern
[`unnested_or_patterns`]: https://rust-lang.github.io/rust-clippy/master/index.html#unnested_or_patterns
[`unreachable`]: https://rust-lang.github.io/rust-clippy/master/index.html#unreachable
Expand Down Expand Up @@ -6216,6 +6223,7 @@ Released 2018-09-13
[`useless_conversion`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_conversion
[`useless_format`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_format
[`useless_let_if_seq`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_let_if_seq
[`useless_nonzero_new_unchecked`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_nonzero_new_unchecked
[`useless_transmute`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_transmute
[`useless_vec`]: https://rust-lang.github.io/rust-clippy/master/index.html#useless_vec
[`vec_box`]: https://rust-lang.github.io/rust-clippy/master/index.html#vec_box
Expand Down
6 changes: 3 additions & 3 deletions src/tools/clippy/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ currently. Between writing new lints, fixing issues, reviewing pull requests and
responding to issues there may not always be enough time to stay on top of it
all.

Our highest priority is fixing [crashes][l-crash] and [bugs][l-bug], for example
Our highest priority is fixing [ICEs][I-ICE] and [bugs][C-bug], for example
an ICE in a popular crate that many other crates depend on. We don't
want Clippy to crash on your code and we want it to be as reliable as the
suggestions from Rust compiler errors.
Expand All @@ -213,8 +213,8 @@ Or rather: before the sync this should be addressed,
e.g. by removing a lint again, so it doesn't hit beta/stable.

[triage]: https://forge.rust-lang.org/release/triage-procedure.html
[l-crash]: https://github.com/rust-lang/rust-clippy/labels/L-crash
[l-bug]: https://github.com/rust-lang/rust-clippy/labels/L-bug
[I-ICE]: https://github.com/rust-lang/rust-clippy/labels/I-ICE
[C-bug]: https://github.com/rust-lang/rust-clippy/labels/C-bug
[p-low]: https://github.com/rust-lang/rust-clippy/labels/P-low
[p-medium]: https://github.com/rust-lang/rust-clippy/labels/P-medium
[p-high]: https://github.com/rust-lang/rust-clippy/labels/P-high
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ license = "MIT OR Apache-2.0"
keywords = ["clippy", "lint", "plugin"]
categories = ["development-tools", "development-tools::cargo-plugins"]
build = "build.rs"
edition = "2021"
edition = "2024"
publish = false

[[bin]]
Expand Down
6 changes: 3 additions & 3 deletions src/tools/clippy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ line. (You can swap `clippy::all` with the specific lint category you are target
You can add options to your code to `allow`/`warn`/`deny` Clippy lints:

* the whole set of `Warn` lints using the `clippy` lint group (`#![deny(clippy::all)]`).
Note that `rustc` has additional [lint groups](https://doc.rust-lang.org/rustc/lints/groups.html).
Note that `rustc` has additional [lint groups](https://doc.rust-lang.org/rustc/lints/groups.html).

* all lints using both the `clippy` and `clippy::pedantic` lint groups (`#![deny(clippy::all)]`,
`#![deny(clippy::pedantic)]`). Note that `clippy::pedantic` contains some very aggressive
lints prone to false positives.
`#![deny(clippy::pedantic)]`). Note that `clippy::pedantic` contains some very aggressive
lints prone to false positives.

* only some lints (`#![deny(clippy::single_match, clippy::box_vec)]`, etc.)

Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/book.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ src = "src"
title = "Clippy Documentation"

[rust]
edition = "2018"
edition = "2024"

[output.html]
edit-url-template = "https://github.com/rust-lang/rust-clippy/edit/master/book/{path}"
Expand Down
13 changes: 7 additions & 6 deletions src/tools/clippy/book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,11 @@ This is good, because it makes writing this particular lint less complicated.
We have to make this decision with every new Clippy lint. It boils down to using
either [`EarlyLintPass`][early_lint_pass] or [`LateLintPass`][late_lint_pass].

In short, the `EarlyLintPass` runs before type checking and
[HIR](https://rustc-dev-guide.rust-lang.org/hir.html) lowering and the `LateLintPass`
has access to type information. Consider using the `LateLintPass` unless you need
something specific from the `EarlyLintPass`.
`EarlyLintPass` runs before type checking and
[HIR](https://rustc-dev-guide.rust-lang.org/hir.html) lowering, while `LateLintPass`
runs after these stages, providing access to type information. The `cargo dev new_lint` command
defaults to the recommended `LateLintPass`, but you can specify `--pass=early` if your lint
only needs AST level analysis.

Since we don't need type information for checking the function name, we used
`--pass=early` when running the new lint automation and all the imports were
Expand Down Expand Up @@ -537,7 +538,7 @@ via `Tools -> Clippy` and you should see the generated code in the output below.
If the command was executed successfully, you can copy the code over to where
you are implementing your lint.

[author_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=9a12cb60e5c6ad4e3003ac6d5e63cf55
[author_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=9a12cb60e5c6ad4e3003ac6d5e63cf55

## Print HIR lint

Expand All @@ -552,7 +553,7 @@ attribute to expressions you often need to enable
_Clippy_.

[_High-Level Intermediate Representation (HIR)_]: https://rustc-dev-guide.rust-lang.org/hir.html
[print_hir_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=daf14db3a7f39ca467cd1b86c34b9afb
[print_hir_example]: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2024&gist=daf14db3a7f39ca467cd1b86c34b9afb

## Documentation

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,10 +265,10 @@ functions to deal with macros:
```

[Ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.Ty.html
[TyKind]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/enum.TyKind.html
[TyKind]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_type_ir/ty_kind/enum.TyKind.html
[TypeckResults]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TypeckResults.html
[expr_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TypeckResults.html#method.expr_ty
[LateContext]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/struct.LateContext.html
[TyCtxt]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TyCtxt.html
[pat_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/context/struct.TypeckResults.html#method.pat_ty
[pat_ty]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TypeckResults.html#method.pat_ty
[paths]: https://doc.rust-lang.org/nightly/nightly-rustc/clippy_utils/paths/index.html
4 changes: 2 additions & 2 deletions src/tools/clippy/book/src/development/defining_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ Untracked files:
```


## The `define_clippy_lints` macro
## The `declare_clippy_lint` macro

After `cargo dev new_lint`, you should see a macro with the name
`define_clippy_lints`. It will be in the same file if you defined a standalone
`declare_clippy_lint`. It will be in the same file if you defined a standalone
lint, and it will be in `mod.rs` if you defined a type-specific lint.

The macro looks something like this:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,9 @@ git tag rust-1.XX.0 # XX should be exchanged with the correspondin
git push upstream rust-1.XX.0 # `upstream` is the `rust-lang/rust-clippy` remote
```

After this, the release should be available on the Clippy [release page].
After this, the release should be available on the Clippy [tags page].

[release page]: https://github.com/rust-lang/rust-clippy/releases
[tags page]: https://github.com/rust-lang/rust-clippy/tags

## Publish `clippy_utils`

Expand Down
Loading
Loading