Skip to content

Clippy subtree update #141044

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 121 commits into from
May 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
121 commits
Select commit Hold shift + click to select a range
7bfb15c
Fix `new_lint` clippy command
GuillaumeGomez Apr 17, 2025
0b27121
Fix clippy::version of elidable_lifetime_names to 1.87
corneliusroemer Apr 19, 2025
8858b35
Fix a few more `clippy::version`s
corneliusroemer Apr 27, 2025
c7d3d6d
Update clippy_lints/src/manual_abs_diff.rs
corneliusroemer Apr 27, 2025
36c3617
Remove `is_normalizable`. `layout_of` no longer contains a `delay_bug`.
Jarcho Apr 30, 2025
782c606
fix: `unused_async` FP on default impl
profetia May 1, 2025
dd5113d
Merge commit '03a5b6b976ac121f4233775c49a4bce026065b47' into clippy-s…
flip1995 May 1, 2025
a53acef
Remove `is_normalizable` (#14717)
dswij May 1, 2025
33ea0b4
fix: `manual_slice_fill` FP on `IndexMut` overload
profetia May 1, 2025
fb9508d
Fix `new_lint` clippy command (#14642)
Jarcho May 2, 2025
56f0182
fix: `manual_slice_fill` FP on `IndexMut` overload (#14719)
Manishearth May 2, 2025
3564afa
Implement Iterator::last for vec::IntoIter
thaliaarchi Apr 13, 2025
7106e21
fix: `manual_unwrap_or_default` FP on ref binding
profetia May 3, 2025
c468552
add allow_unused config to missing_docs_in_private_items
quangcito Mar 23, 2025
91a0622
move the implementation under check_def_field
quangcito Mar 24, 2025
481abc1
fix doc
quangcito May 3, 2025
64880ca
add test 3, fmt and lint
quangcito May 3, 2025
7b7a9a6
Don't warn about unloaded crates
smoelius May 4, 2025
ea13461
Don't warn about unloaded crates (#14733)
Alexendoo May 4, 2025
b768fbe
Replace str path utils with new `PathLookup` type
Alexendoo Apr 28, 2025
f23772c
Move `lookup_path` and similar into `clippy_utils::paths`
Alexendoo May 4, 2025
689e62b
fix: `unused_async` FP on default impl (#14720)
blyxyas May 5, 2025
afaedbb
Rename Instance::new to Instance::new_raw and add a note that it is raw
compiler-errors Apr 28, 2025
59aaecb
Handle rustc_middle cases of rustc::potential_query_instability lint
ismailarilik May 5, 2025
e21b936
Read PR body from event in clippy_changelog action
Alexendoo May 5, 2025
f60d7f9
Read PR body from event in clippy_changelog action (#14736)
flip1995 May 5, 2025
9d5bb00
Remove myself from users on vacation
samueltardieu May 5, 2025
003fc6c
Remove myself from users on vacation (#14737)
samueltardieu May 5, 2025
f62f269
Fix `manual_unwrap_or_default` FP on ref binding (#14731)
Jarcho May 5, 2025
c1586e1
Replace str path utils with new `PathLookup` type (#14705)
Jarcho May 5, 2025
32e150d
Auto merge of #131160 - ismailarilik:handle-potential-query-instabili…
bors May 6, 2025
8c93668
Gate collapsible_if let_chains lints on edition 2024 and MSRV
Alexendoo May 1, 2025
e89cf4d
`item_name_repetitions`: exclude enum variants with identical path co…
aaron-ang Apr 15, 2025
50e0bf1
Gate collapsible_if let_chains lints on edition 2024 and MSRV (#14723)
samueltardieu May 6, 2025
e7acf5c
fix: `collapsible_if` FP on block stmt before expr
profetia May 3, 2025
874ad22
Rollup merge of #139773 - thaliaarchi:vec-into-iter-last, r=workingju…
Zalathar May 6, 2025
7fdded3
Fix `collapsible_if` FP on block stmt before expr (#14730)
samueltardieu May 6, 2025
d0af404
fix: `manual_let_else` FN when diverges on simple enum variant
profetia May 6, 2025
94aa0d9
Update clippy_lints_internal to 2024 edition
Alexendoo May 6, 2025
737d3b3
Remove some unused `#![feature]`s
Alexendoo May 6, 2025
cf6bebb
Remove some unused `#![feature]`s (#14738)
Alexendoo May 6, 2025
73dd05c
add allow_unused config to missing_docs_in_private_items (#14453)
samueltardieu May 6, 2025
fc811f7
`item_name_repetitions`: exclude enum variants with identical path co…
Manishearth May 6, 2025
cc5d1a5
Post `non_std_lazy_statics` type warnings onto the right node
samueltardieu May 6, 2025
999db5c
`unwrap_used`, `expect_used`: accept macro result as receiver
samueltardieu Apr 9, 2025
ca78fb4
`unwrap_used`, `expect_used`: accept macro result as receiver (#14575)
Jarcho May 7, 2025
5aac708
Replace `Symbol::as_str` usage in `match` expressions
Alexendoo May 7, 2025
ca62816
Replace `Symbol::as_str` usage in `match` expressions (#14745)
Manishearth May 7, 2025
772ea35
Fix diagnostic paths printed by dogfood test
Alexendoo May 7, 2025
8c04522
Make `let_with_type_underscore` help message into a suggestion
Alexendoo May 7, 2025
34cd948
Fix diagnostic paths printed by dogfood test (#14746)
Jarcho May 7, 2025
303c4ec
Require T: TypeFoldable in Binder<T> visit
compiler-errors Apr 23, 2025
be40534
Add `primitive_method_to_numeric_cast` lint
GuillaumeGomez Jan 10, 2025
c680419
Add UI test for `primitive_method_to_numeric_cast`
GuillaumeGomez Jan 10, 2025
50cff11
Make `let_with_type_underscore` help message into a suggestion (#14749)
samueltardieu May 7, 2025
f88f9a9
Fix `manual_let_else` FN when diverges on simple enum variant (#14732)
dswij May 7, 2025
06fa045
Rename lint into `confusing_method_to_numeric_cast`
GuillaumeGomez Jan 10, 2025
a94abae
Clarify docs of `CONFUSING_METHOD_TO_NUMERIC_CAST`
GuillaumeGomez May 7, 2025
d17eeb5
triagebot: `canonicalize-issue-links` → `issue-links`
samueltardieu May 7, 2025
1fbfbb5
Fix integer_division false negative for NonZero denominators
alex-semenyuk Apr 21, 2025
e04158c
triagebot: `canonicalize-issue-links` → `issue-links` (#14751)
flip1995 May 8, 2025
b73d3b4
fix issue-14725
relaxcn May 8, 2025
668a292
`unwrap.rs`: replace some strings usage by interned symbols
samueltardieu May 8, 2025
4cbd116
`unwrap.rs`: internal naming cleanup
samueltardieu May 8, 2025
1044e5b
Set Manish in vacation mode
samueltardieu May 8, 2025
33519b7
Set Manish in vacation mode (#14762)
Manishearth May 8, 2025
d8726ca
fix false negative for `unnecessary_unwrap` (#14758)
samueltardieu May 8, 2025
3a6fcd2
Allow any rust-lang team member to close an issue
samueltardieu May 8, 2025
33f81c0
Use `cargo dev setup toolchain` in install from source docs
Alexendoo May 9, 2025
35bdd25
remove superseded lints
bend-n Apr 28, 2025
4a64903
Use `cargo dev setup toolchain` in install from source docs (#14766)
flip1995 May 9, 2025
656b317
Allow any rust-lang team member to close an issue with rustbot (#14765)
flip1995 May 9, 2025
756de2a
remove superseded lints (#14703)
samueltardieu May 9, 2025
a67ee90
`unwrap.rs` cleanup (#14761)
dswij May 9, 2025
16fd2a8
Fix integer_division false negative for NonZero denominators (#14664)
blyxyas May 9, 2025
e4d82ae
Resolve through local re-exports in `lookup_path`
Alexendoo May 9, 2025
bde9390
`char::is_digit()` is const-stable only since Rust 1.87
samueltardieu May 9, 2025
3c5e403
`char::is_digit()` is const-stable only since Rust 1.87 (#14771)
blyxyas May 9, 2025
e61886a
fix `unnecessary_unwrap` emitted twice in closure
relaxcn May 9, 2025
5262ab2
Fix `unnecessary_unwrap` emitted twice in closure (#14763) (#14770)
samueltardieu May 10, 2025
f60807d
Resolve through local re-exports in `lookup_path` (#14772)
dswij May 10, 2025
9ed53b8
Fix ICE in `missing_const_for_fn`
samueltardieu May 10, 2025
7f6d507
Fix ICE in `missing_const_for_fn` (#14776)
blyxyas May 10, 2025
18eb293
update dev doc: update FnKind::Fn matching
donkomura May 11, 2025
c040e9f
`return_and_then`: only lint returning expressions
samueltardieu May 11, 2025
8f5dc85
Use `tempfile::TempDir::keep()` instead of deprecated `into_path()`
samueltardieu May 12, 2025
48337da
Use `tempfile::TempDir::keep()` instead of deprecated `into_path()` (…
flip1995 May 12, 2025
74fd9ed
book: modify FnKind::Fn matching (#14780)
flip1995 May 12, 2025
55b5c83
Changelog for Clippy 1.87
alex-semenyuk May 7, 2025
2ce5451
Changelog for Clippy 1.87 🦡 (#14748)
flip1995 May 12, 2025
b363499
Add new `confusing_method_to_numeric_cast` lint (#13979)
llogiq May 12, 2025
62ba996
Fix clippy::version of elidable_lifetime_names to 1.87 (#14654)
llogiq May 12, 2025
459364b
`return_and_then`: only lint returning expressions (#14783)
llogiq May 12, 2025
01e08a4
Do not use `clippy_utils` from UI tests
samueltardieu May 12, 2025
c6a23f8
Include all bounds in bounds consolidation
samueltardieu May 7, 2025
83248e5
Fix messages for `type_repetition_in_bounds` (#14752)
llogiq May 12, 2025
2215282
Update Changelog update walkthrough docs section
alex-semenyuk May 11, 2025
54aa120
Update "Changelog update walkthrough" section (#14785)
flip1995 May 12, 2025
bfc6ad0
Do not use `clippy_utils` from UI tests (#14788)
flip1995 May 12, 2025
2f39264
clippy_dev: Set the current directory to clippy's root path.
Jarcho Apr 13, 2025
3fe5fb2
clippy_dev: Split `rename` and `deprecate` out of `update_lints`
Jarcho Apr 14, 2025
98cb92f
clippy_dev: Reuse buffers when updating files and don't write unchang…
Jarcho Apr 14, 2025
2c85cb0
clippy_dev: Only build `AhoCorasick` searcher once for multiple files.
Jarcho Apr 14, 2025
97abf33
clippy_dev: Split gathering lint decls from parsing deprecated lints.
Jarcho Apr 15, 2025
a9beb8b
clippy_dev: Refactor token parsing to avoid macros.
Jarcho Apr 15, 2025
0636121
clippy_dev: Remove print option from `update_lints`
Jarcho Apr 15, 2025
40e1b0e
add lint `cloned_ref_to_slice_refs`
asdfish Mar 16, 2025
7bac114
Add new lint: `cloned_ref_to_slice_refs` (#14284)
llogiq May 13, 2025
9f4ecea
Add internal lint `derive_deserialize_allowing_unknown`
smoelius Mar 6, 2025
17f2a87
Add internal lint `derive_deserialize_allowing_unknown` (#14360)
llogiq May 13, 2025
373df52
Post `non_std_lazy_statics` type warnings onto the right node (#14740)
Jarcho May 14, 2025
488e4e5
Add the `allow_exact_repetitions` option to the `module_name_repetiti…
SLUCHABLUB May 14, 2025
1a864f3
Add the `allow_exact_repetitions` option to the `module_name_repetiti…
llogiq May 14, 2025
40bead0
`clippy_dev` refactor (#14616)
dswij May 14, 2025
0bb1b5b
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 May 15, 2025
5be888c
Bump nightly version -> 2025-05-14
flip1995 May 15, 2025
3670731
Bump Clippy version -> 0.1.89
flip1995 May 15, 2025
0450db3
Rustup (#14815)
flip1995 May 15, 2025
825a62a
Merge commit '0450db33a5d8587f7c1d4b6d233dac963605766b' into clippy-s…
flip1995 May 15, 2025
afa6d67
Update Cargo.lock
flip1995 May 15, 2025
60750ca
tempfile dep bump fallout
flip1995 May 15, 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
12 changes: 6 additions & 6 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6"

[[package]]
name = "clippy"
version = "0.1.88"
version = "0.1.89"
dependencies = [
"anstream",
"askama",
Expand Down Expand Up @@ -569,7 +569,7 @@ dependencies = [

[[package]]
name = "clippy_config"
version = "0.1.88"
version = "0.1.89"
dependencies = [
"clippy_utils",
"itertools",
Expand All @@ -594,7 +594,7 @@ dependencies = [

[[package]]
name = "clippy_lints"
version = "0.1.88"
version = "0.1.89"
dependencies = [
"arrayvec",
"cargo_metadata 0.18.1",
Expand Down Expand Up @@ -624,7 +624,7 @@ dependencies = [

[[package]]
name = "clippy_utils"
version = "0.1.88"
version = "0.1.89"
dependencies = [
"arrayvec",
"itertools",
Expand Down Expand Up @@ -5084,9 +5084,9 @@ dependencies = [

[[package]]
name = "tempfile"
version = "3.19.1"
version = "3.20.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7437ac7763b9b123ccf33c338a5cc1bac6f69b45a136c19bdd8a65e3916435bf"
checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1"
dependencies = [
"fastrand",
"getrandom 0.3.2",
Expand Down
2 changes: 1 addition & 1 deletion compiler/rustc_data_structures/src/temp_dir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ impl Drop for MaybeTempDir {
// occur.
let dir = unsafe { ManuallyDrop::take(&mut self.dir) };
if self.keep {
let _ = dir.into_path();
let _ = dir.keep();
}
}
}
Expand Down
17 changes: 4 additions & 13 deletions src/tools/clippy/.github/workflows/clippy_changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,18 @@ 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/${{ github.repository }}/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."
if [[ -z $(grep -oP 'changelog: *\K\S+' <<< "$PR_BODY") ]]; 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 }}'
PR_BODY: ${{ github.event.pull_request.body }})


# We need to have the "conclusion" job also on PR CI, to make it possible
# to add PRs to a merge queue.
Expand Down
104 changes: 103 additions & 1 deletion src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,105 @@ document.

## Unreleased / Beta / In Rust Nightly

[3e3715c3...master](https://github.com/rust-lang/rust-clippy/compare/3e3715c3...master)
[1e5237f4...master](https://github.com/rust-lang/rust-clippy/compare/1e5237f4...master)

## Rust 1.87

Current stable, released 2025-05-15

[View all 127 merged pull requests](https://github.com/rust-lang/rust-clippy/pulls?q=merged%3A2025-02-06T14%3A54%3A28Z..2025-03-20T20%3A07%3A53Z+base%3Amaster)

### New Lints

* Added [`doc_comment_double_space_linebreaks`] to `pedantic` [#12876](https://github.com/rust-lang/rust-clippy/pull/12876)
* Added [`manual_midpoint`] to `pedantic` [#13851](https://github.com/rust-lang/rust-clippy/pull/13851)
* Added [`io_other_error`] to `style` [#14022](https://github.com/rust-lang/rust-clippy/pull/14022)
* Added [`owned_cow`] to `pedantic` [#13948](https://github.com/rust-lang/rust-clippy/pull/13948)
* Added [`manual_contains`] to `perf` [#13817](https://github.com/rust-lang/rust-clippy/pull/13817)
* Added [`unnecessary_debug_formatting`] to `pedantic` [#13893](https://github.com/rust-lang/rust-clippy/pull/13893)
* Added [`elidable_lifetime_names`] to `pedantic` [#13960](https://github.com/rust-lang/rust-clippy/pull/13960)
* Added [`mem_replace_option_with_some`] to `style` [#14197](https://github.com/rust-lang/rust-clippy/pull/14197)
* Added [`unbuffered_bytes`] to `perf` [#14089](https://github.com/rust-lang/rust-clippy/pull/14089)
* Added [`single_option_map`] to `nursery` [#14033](https://github.com/rust-lang/rust-clippy/pull/14033)

### Moves and Deprecations

* Moved [`comparison_chain`] to `pedantic` (from `style`)
[#14219](https://github.com/rust-lang/rust-clippy/pull/14219)
* Moved [`manual_ok_or`] to `style` (from `pedantic`)
[#14027](https://github.com/rust-lang/rust-clippy/pull/14027)
* Deprecated [`option_map_or_err_ok`] in favor of [`manual_ok_or`]
[#14027](https://github.com/rust-lang/rust-clippy/pull/14027)

### Enhancements

* Add `allow_expect_in_consts` and `allow_unwrap_in_consts` configuration options to [`unwrap_used`], [`expect_used`]
[#14200](https://github.com/rust-lang/rust-clippy/pull/14200)
* Add `check-incompatible-msrv-in-tests` configuration option to [`incompatible_msrv`]
[#14279](https://github.com/rust-lang/rust-clippy/pull/14279)
* [`len_zero`] now also triggers if deref target implements `is_empty()`
[#13871](https://github.com/rust-lang/rust-clippy/pull/13871)
* [`ptr_eq`] now handles more cases, including `!=` in addition to `==`
[#14339](https://github.com/rust-lang/rust-clippy/pull/14339)
* [`struct_field_names`] now also checks private fields of public structs
[#14076](https://github.com/rust-lang/rust-clippy/pull/14076)
* [`needless_pass_by_value`] suggests using a reference on the innermost `Option` content
[#14392](https://github.com/rust-lang/rust-clippy/pull/14392)
* [`obfuscated_if_else`] now supports `then().unwrap_or_else()` and `then_some().unwrap_or_else()`
[#14165](https://github.com/rust-lang/rust-clippy/pull/14165)
* Format macros: all format-handling lints now validate `todo!` and `unimplemented!` macros
[#14266](https://github.com/rust-lang/rust-clippy/pull/14266)
* [`disallowed_methods`] now supports replacements
[#13669](https://github.com/rust-lang/rust-clippy/pull/13669)
* Added MSRV checks for several lints:
* [`question_mark`] [#14436](https://github.com/rust-lang/rust-clippy/pull/14436)
* [`repeat_vec_with_capacity`] [#14126](https://github.com/rust-lang/rust-clippy/pull/14126)
* [`manual_flatten`] [#14086](https://github.com/rust-lang/rust-clippy/pull/14086)
* [`lines_filter_map_ok`] [#14130](https://github.com/rust-lang/rust-clippy/pull/14130)

### False Positive Fixes

* [`missing_const_for_fn`] no longer triggers on unstable const traits [#14294](https://github.com/rust-lang/rust-clippy/pull/14294)
* [`unnecessary_to_owned`] now avoids suggesting to call `iter()` on a temporary object [#14243](https://github.com/rust-lang/rust-clippy/pull/14243)
* [`unnecessary_debug_formatting`] no longer triggers in tests [#14347](https://github.com/rust-lang/rust-clippy/pull/14347)
* [`option_if_let_else`] now handles cases when value is partially moved [#14209](https://github.com/rust-lang/rust-clippy/pull/14209)
* [`blocks_in_conditions`] no longer triggers when the condition contains a `return` [#14338](https://github.com/rust-lang/rust-clippy/pull/14338)
* [`undocumented_unsafe_blocks`] no longer triggers on trait/impl items [#13888](https://github.com/rust-lang/rust-clippy/pull/13888)
* [`manual_slice_fill`] no longer triggers due to missing index checks [#14193](https://github.com/rust-lang/rust-clippy/pull/14193)
* [`useless_asref`] no longer suggests using `.clone()` if the target type doesn't implement `Clone` [#14174](https://github.com/rust-lang/rust-clippy/pull/14174)
* [`unnecessary_safety_comment`] no longer triggers on desugared assign [#14371](https://github.com/rust-lang/rust-clippy/pull/14371)
* [`unnecessary_map_or`] no longer consumes the comparison value if it does not implement `Copy` [#14207](https://github.com/rust-lang/rust-clippy/pull/14207)
* [`let_and_return`] no longer triggers involving short-lived block temporary variables [#14180](https://github.com/rust-lang/rust-clippy/pull/14180)
* [`manual_async_fn`] no longer emits suggestions inside macros [#14142](https://github.com/rust-lang/rust-clippy/pull/14142)
* [`use_self`] skips analysis inside macro expansions of a `impl Self` block [#13128](https://github.com/rust-lang/rust-clippy/pull/13128)
* [`double_ended_iterator_last`] no longer triggers on non-reference immutable receiver [#14140](https://github.com/rust-lang/rust-clippy/pull/14140)

### ICE Fixes

* [`macro_use_imports`] Fix ICE when checking attributes
[#14317](https://github.com/rust-lang/rust-clippy/pull/14317)
* [`doc_nested_refdefs`] Fix ICE by avoiding invalid ranges
[#14308](https://github.com/rust-lang/rust-clippy/pull/14308)
* [`just_underscores_and_digits`] Fix ICE in error recovery scenario
[#14168](https://github.com/rust-lang/rust-clippy/pull/14168)
* [`declare_interior_mutable_const`], [`borrow_interior_mutable_const`] Fix ICE by properly resolving `<T as Trait>::AssocT` projections
[#14125](https://github.com/rust-lang/rust-clippy/pull/14125)

### Documentation Improvements

* [`struct_excessive_bools`] Documentation improved with rationale
[#14351](https://github.com/rust-lang/rust-clippy/pull/14351)

### Others

* Use edition=2021 in `rustc_tools_util`
[#14211](https://github.com/rust-lang/rust-clippy/pull/14211)
* Fix rustc_tools_util's `version.host_compiler` release channel, expose the rustc version, and add tests
[#14123](https://github.com/rust-lang/rust-clippy/pull/14123)
* Make UI test annotations mandatory
[#11421](https://github.com/rust-lang/rust-clippy/pull/11421)
[#14388](https://github.com/rust-lang/rust-clippy/pull/14388)
[#14393](https://github.com/rust-lang/rust-clippy/pull/14393)

## Rust 1.86

Expand Down Expand Up @@ -5583,6 +5681,7 @@ Released 2018-09-13
[`clone_on_copy`]: https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_copy
[`clone_on_ref_ptr`]: https://rust-lang.github.io/rust-clippy/master/index.html#clone_on_ref_ptr
[`cloned_instead_of_copied`]: https://rust-lang.github.io/rust-clippy/master/index.html#cloned_instead_of_copied
[`cloned_ref_to_slice_refs`]: https://rust-lang.github.io/rust-clippy/master/index.html#cloned_ref_to_slice_refs
[`cmp_nan`]: https://rust-lang.github.io/rust-clippy/master/index.html#cmp_nan
[`cmp_null`]: https://rust-lang.github.io/rust-clippy/master/index.html#cmp_null
[`cmp_owned`]: https://rust-lang.github.io/rust-clippy/master/index.html#cmp_owned
Expand All @@ -5594,6 +5693,7 @@ Released 2018-09-13
[`collection_is_never_read`]: https://rust-lang.github.io/rust-clippy/master/index.html#collection_is_never_read
[`comparison_chain`]: https://rust-lang.github.io/rust-clippy/master/index.html#comparison_chain
[`comparison_to_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#comparison_to_empty
[`confusing_method_to_numeric_cast`]: https://rust-lang.github.io/rust-clippy/master/index.html#confusing_method_to_numeric_cast
[`const_is_empty`]: https://rust-lang.github.io/rust-clippy/master/index.html#const_is_empty
[`const_static_lifetime`]: https://rust-lang.github.io/rust-clippy/master/index.html#const_static_lifetime
[`copy_iterator`]: https://rust-lang.github.io/rust-clippy/master/index.html#copy_iterator
Expand Down Expand Up @@ -6383,6 +6483,7 @@ Released 2018-09-13
[`accept-comment-above-statement`]: https://doc.rust-lang.org/clippy/lint_configuration.html#accept-comment-above-statement
[`allow-comparison-to-zero`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-comparison-to-zero
[`allow-dbg-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-dbg-in-tests
[`allow-exact-repetitions`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-exact-repetitions
[`allow-expect-in-consts`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-expect-in-consts
[`allow-expect-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-expect-in-tests
[`allow-indexing-slicing-in-tests`]: https://doc.rust-lang.org/clippy/lint_configuration.html#allow-indexing-slicing-in-tests
Expand Down Expand Up @@ -6435,6 +6536,7 @@ Released 2018-09-13
[`max-suggested-slice-pattern-length`]: https://doc.rust-lang.org/clippy/lint_configuration.html#max-suggested-slice-pattern-length
[`max-trait-bounds`]: https://doc.rust-lang.org/clippy/lint_configuration.html#max-trait-bounds
[`min-ident-chars-threshold`]: https://doc.rust-lang.org/clippy/lint_configuration.html#min-ident-chars-threshold
[`missing-docs-allow-unused`]: https://doc.rust-lang.org/clippy/lint_configuration.html#missing-docs-allow-unused
[`missing-docs-in-crate-items`]: https://doc.rust-lang.org/clippy/lint_configuration.html#missing-docs-in-crate-items
[`module-item-order-groupings`]: https://doc.rust-lang.org/clippy/lint_configuration.html#module-item-order-groupings
[`module-items-ordered-within-groupings`]: https://doc.rust-lang.org/clippy/lint_configuration.html#module-items-ordered-within-groupings
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ debugging to find the actual problem behind the issue.

[`T-middle`] issues can be more involved and require verifying types. The [`ty`] module contains a
lot of methods that are useful, though one of the most useful would be `expr_ty` (gives the type of
an AST expression). `match_def_path()` in Clippy's `utils` module can also be useful.
an AST expression).

[`good-first-issue`]: https://github.com/rust-lang/rust-clippy/labels/good-first-issue
[`S-inactive-closed`]: https://github.com/rust-lang/rust-clippy/pulls?q=is%3Aclosed+label%3AS-inactive-closed
Expand Down
5 changes: 2 additions & 3 deletions src/tools/clippy/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "clippy"
# begin autogenerated version
version = "0.1.88"
version = "0.1.89"
# end autogenerated version
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
repository = "https://github.com/rust-lang/rust-clippy"
Expand All @@ -28,7 +28,7 @@ clippy_lints = { path = "clippy_lints" }
clippy_utils = { path = "clippy_utils" }
rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
clippy_lints_internal = { path = "clippy_lints_internal", optional = true }
tempfile = { version = "3.3", optional = true }
tempfile = { version = "3.20", optional = true }
termize = "0.1"
color-print = "0.3.4"
anstream = "0.6.18"
Expand All @@ -47,7 +47,6 @@ pulldown-cmark = { version = "0.11", default-features = false, features = ["html
askama = { version = "0.13", default-features = false, features = ["alloc", "config", "derive"] }

# UI test dependencies
clippy_utils = { path = "clippy_utils" }
if_chain = "1.0"
quote = "1.0.25"
syn = { version = "2.0", features = ["full"] }
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/development/adding_lints.md
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ In our example, `is_foo_fn` looks like:

fn is_foo_fn(fn_kind: FnKind<'_>) -> bool {
match fn_kind {
FnKind::Fn(_, ident, ..) => {
FnKind::Fn(_, _, Fn { ident, .. }) => {
// check if `fn` name is `foo`
ident.name.as_str() == "foo"
}
Expand Down
28 changes: 9 additions & 19 deletions src/tools/clippy/book/src/development/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,42 +145,32 @@ unclear to you.
If you are hacking on Clippy and want to install it from source, do the
following:

First, take note of the toolchain
[override](https://rust-lang.github.io/rustup/overrides.html) in
`/rust-toolchain.toml`. We will use this override to install Clippy into the right
toolchain.

> Tip: You can view the active toolchain for the current directory with `rustup
> show active-toolchain`.
From the Clippy project root, run the following command to build the Clippy
binaries and copy them into the toolchain directory. This will override the
currently installed Clippy component.
binaries and copy them into the toolchain directory. This will create a new
toolchain called `clippy` by default, see `cargo dev setup toolchain --help`
for other options.

```terminal
cargo build --release --bin cargo-clippy --bin clippy-driver -Zunstable-options --out-dir "$(rustc --print=sysroot)/bin"
cargo dev setup toolcahin
```

Now you may run `cargo clippy` in any project, using the toolchain where you
just installed Clippy.
Now you may run `cargo +clippy clippy` in any project using the new toolchain.

```terminal
cd my-project
cargo +nightly-2021-07-01 clippy
cargo +clippy clippy
```

...or `clippy-driver`

```terminal
clippy-driver +nightly-2021-07-01 <filename>
clippy-driver +clippy <filename>
```

If you need to restore the default Clippy installation, run the following (from
the Clippy project root).
If you no longer need the toolchain it can be uninstalled using `rustup`:

```terminal
rustup component remove clippy
rustup component add clippy
rustup toolchain uninstall clippy
```

> **DO NOT** install using `cargo install --path . --force` since this will
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ arguments have to be checked separately.

```rust
use clippy_utils::ty::{is_type_diagnostic_item, is_type_lang_item};
use clippy_utils::{paths, match_def_path};
use clippy_utils::paths;
use rustc_span::symbol::sym;
use rustc_hir::LangItem;

Expand All @@ -108,7 +108,7 @@ impl LateLintPass<'_> for MyStructLint {

// 3. Using the type path
// This method should be avoided if possible
if match_def_path(cx, def_id, &paths::RESULT) {
if paths::RESULT.matches_ty(cx, ty) {
// The type is a `core::result::Result`
}
}
Expand Down
Loading
Loading