Skip to content

Update Clippy #99406

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 153 commits into from
Jul 18, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
153 commits
Select commit Hold shift + click to select a range
d42af68
Add `cargo dev dogfood`
Serial-ATA Jun 23, 2022
c582002
Changelog for Rust 1.62 :t-rex:
xFrednet Jun 27, 2022
131770d
Add `dev dogfood` to the book
Serial-ATA Jun 30, 2022
09f5df5
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
flip1995 Jun 30, 2022
a131cea
Make sure bors success depends on metadata_collection
flip1995 Jun 30, 2022
6c61f71
Uncomment test for #8734
Alexendoo Jun 30, 2022
6206d2a
Auto merge of #9070 - flip1995:ci-fix, r=xFrednet
bors Jun 30, 2022
4198013
Auto merge of #9071 - Alexendoo:8734, r=dswij
bors Jun 30, 2022
b705107
Fix false-positive in `equatable_if_let`
daxpedda Jun 30, 2022
d7e5dab
Auto merge of #9074 - daxpedda:equatable-if-let-external-macro, r=Man…
bors Jun 30, 2022
c505326
Add `dev deprecate` to the development basics
Serial-ATA Jun 30, 2022
2d01959
Auto merge of #9058 - xFrednet:changelog-1-62, r=flip1995
bors Jun 30, 2022
a2b8a67
Fix broken hyperlink
ranile Jun 30, 2022
6177a4f
Auto merge of #9078 - hamza1311:patch-1, r=xFrednet
bors Jun 30, 2022
23db5ce
Auto merge of #9075 - Serial-ATA:update-docs, r=flip1995
bors Jun 30, 2022
d4488a5
Auto merge of #9039 - Serial-ATA:dev-dogfood, r=giraffate
bors Jul 1, 2022
a5b70a4
Fix allow attributes in let_unit_value
Alexendoo Jul 1, 2022
1988375
Fix some links
giraffate Jul 1, 2022
d8970bf
Auto merge of #9083 - giraffate:fix_link_in_changelog, r=flip1995
bors Jul 1, 2022
5de8590
Factor out hir::Node::Binding
camsteffen Jun 28, 2022
d5e33d3
Shorten def_span for more items.
cjgillot Feb 13, 2022
097f765
Auto merge of #9082 - Alexendoo:let_unit_allow, r=xFrednet
bors Jul 1, 2022
a86bf81
Correct lint version for `format_push_string`
xFrednet Jul 1, 2022
f30b68d
Auto merge of #9085 - xFrednet:9081-update-format-push-version, r=Man…
bors Jul 1, 2022
7350525
Fix link
alex-semenyuk Jul 1, 2022
8c341d6
Auto merge of #9087 - alex-semenyuk:fix_link, r=llogiq
bors Jul 1, 2022
3e80d39
Fix ICE in `dereference.rs`
Jarcho Jul 2, 2022
053caf8
Rollup merge of #98639 - camsteffen:no-node-binding, r=compiler-errors
Dylan-DPC Jul 2, 2022
988b813
Use correct substitutions when checking if `needless_borrow` can appl…
Jarcho Jul 2, 2022
ab23b3a
ast: Add span to `Extern`
aDotInTheVoid Jul 2, 2022
815a3cc
corrected README.md book link
usefulmove Jul 3, 2022
b8bdbb7
Auto merge of #9106 - usefulmove:master, r=flip1995
bors Jul 3, 2022
65655d1
Remove trailing spaces
alex-semenyuk Jul 3, 2022
2dd5fc1
Correct `[clippy::version]` for 1.62 lints and add note to docs
xFrednet Jul 3, 2022
0fd4f1c
Auto merge of #9112 - xFrednet:9088-fix-lint-versions, r=Jarcho
bors Jul 3, 2022
9ef76e0
Fixed comment
alex-semenyuk Jul 3, 2022
be9e35f
Auto merge of #9110 - alex-semenyuk:fix_trailling_commas, r=xFrednet
bors Jul 3, 2022
de646e1
Add `invalid_utf8_in_unchecked`
Serial-ATA Jul 3, 2022
8c89877
Auto merge of #9105 - Serial-ATA:lint-invalid-utf8, r=Jarcho
bors Jul 3, 2022
b15f06e
Auto merge of #9093 - Jarcho:deref_ice, r=giraffate
bors Jul 4, 2022
fec4593
new_without_default: ignore const generics/lifetime params on fn new
Alexendoo Jul 4, 2022
9756679
Fix `undocumented_unsafe_blocks` in closures
Jarcho Jul 4, 2022
c257f09
Auto merge of #9115 - Alexendoo:new-with-const-generics, r=llogiq
bors Jul 4, 2022
48e527e
Auto merge of #9117 - Jarcho:unsafe_block_closure, r=giraffate
bors Jul 5, 2022
2ccb054
Fix stderr for cast_size_32bit
alex-semenyuk Jul 5, 2022
462136a
Auto merge of #9121 - alex-semenyuk:fix_ui_test_cast_32_bits, r=flip1995
bors Jul 5, 2022
3db0e00
Lint `shadow_*` lints in anon const blocks
Jarcho Jul 5, 2022
fd605ab
Auto merge of #9124 - Jarcho:shadow_ice, r=Alexendoo
bors Jul 5, 2022
5c35569
Relax constrained generics to TypeVisitable
eggyal Jun 17, 2022
490c773
Update TypeVisitor paths
eggyal Jun 17, 2022
528308b
Extend unnecessary_lazy_eval to cover `bool::then` -> `bool::then_some`
joshtriplett Jul 2, 2022
ebff720
Add MSRV check for `bool::then_some`
joshtriplett Jul 6, 2022
f84d9bc
Build the Clippy book as part of x.py doc
flip1995 Jul 3, 2022
b7230d4
Dogfood fixes to use `bool::then_some`
joshtriplett Jul 6, 2022
f93d418
Auto merge of #9099 - joshtriplett:unnecessary-lazy-eval-then-some, r…
bors Jul 6, 2022
e34ee24
fix miri-opt tests
TaKO8Ki Jul 6, 2022
0d443d1
Fix `#[expect]` and `#[allow]` for `clippy::duplicate_mod`
xFrednet Jun 25, 2022
afb34eb
Auto merge of #9096 - Jarcho:needless_borrow_subs, r=Manishearth
bors Jul 6, 2022
5483a7d
Auto merge of #98827 - aDotInTheVoid:suggest-extern-block, r=nagisa
bors Jul 7, 2022
cac25cd
Move `predecessors` from Body to BasicBlocks
tmiasko Jul 5, 2022
347d999
Shorten span for closures.
cjgillot Jun 27, 2022
f2bef55
trait_bounds: rework two loops into one
hellow554 Jul 7, 2022
ead2c4f
fix incorrect suggestion for maybe trait bounds
hellow554 Jul 7, 2022
6293da2
`UnsafeCell` now has no niches, ever.
oli-obk Jul 7, 2022
307b8cd
Lint simple expressions in manual_filter_map, manual_find_map
Alexendoo Jun 6, 2022
4f9933a
Rollup merge of #98507 - xFrednet:rfc-2383-manual-expectation-magic, …
Dylan-DPC Jul 7, 2022
5474f56
Rollup merge of #98930 - tmiasko:pub-basic-blocks, r=oli-obk
Dylan-DPC Jul 7, 2022
7142a59
Auto merge of #9132 - hellow554:maybe_trait_bound_on_type_repetition,…
bors Jul 7, 2022
3388787
Add test for and fix rust-lang/rust-clippy#9131
anall Jul 7, 2022
782b484
Fix ICE in sugg::DerefDelegate with (named) closures
anall Jul 4, 2022
2058b92
Auto merge of #9120 - anall:bugfix/ice9041, r=Jarcho
bors Jul 7, 2022
54feac1
Auto merge of #8958 - Alexendoo:simple_filter_map, r=giraffate
bors Jul 7, 2022
196174d
Changes to `let_unit_value`
Jarcho Jun 18, 2022
2872b7e
Allow `let () = ..` as type inference for `let_unit_value`
Jarcho Jun 27, 2022
9fa12de
Improve `while_let_on_iterator` suggestion inside an `FnOnce` closure
Jarcho Jul 7, 2022
bee9da1
Auto merge of #98482 - cjgillot:short-struct-span-closure, r=estebank
bors Jul 8, 2022
1e033a9
Rollup merge of #99026 - anall:buffix/clippy-9131, r=xFrednet
matthiaskrgr Jul 8, 2022
d0b8f75
Simplify if let statements
bors Jul 8, 2022
49f73e1
Auto merge of #8356 - J-ZhengLi:master-issue8288, r=dswij
bors Jul 8, 2022
d251bd9
Add `for_each_expr`
Jarcho Jul 8, 2022
4e60134
Fix example header
alex-semenyuk Jul 8, 2022
526f02e
Auto merge of #9137 - alex-semenyuk:small_cosmetic_fix, r=xFrednet
bors Jul 8, 2022
d053a3d
add opt in attribute for stable-in-unstable items
yaahc May 9, 2022
55563f9
Fixes for `branches_sharing_code`
Jarcho Jul 8, 2022
9015884
Fix small mistakes
alex-semenyuk Jul 9, 2022
95b7879
Ignore the `IntoIterator::into_iter` call from for loops in `signific…
Jarcho Jul 9, 2022
3468294
Auto merge of #9140 - Jarcho:sig_drop, r=flip1995
bors Jul 9, 2022
4d1b976
Auto merge of #9141 - alex-semenyuk:grammar_fix, r=dswij
bors Jul 9, 2022
97cd46f
Fix span for or_fun_call
alex-semenyuk Jul 10, 2022
783992e
Fix dogfood issue for or_fun_call
alex-semenyuk Jul 10, 2022
25fe419
change applicability type to MaybeIncorrect
kyoto7250 Jul 10, 2022
7ea4592
Auto merge of #9056 - Jarcho:let_unit_indirect, r=llogiq
bors Jul 10, 2022
c3c4cda
Address review
alex-semenyuk Jul 11, 2022
8a62b6f
Auto merge of #9144 - alex-semenyuk:or_fun_call_span_fix, r=giraffate
bors Jul 11, 2022
c8d32e5
Fix Clippy version in `derive_partial_eq_without_eq` lint
mati865 Jul 11, 2022
7c1598b
Auto merge of #9152 - mati865:patch-2, r=xFrednet
bors Jul 11, 2022
57a8f6d
Fix broken link in CONTRIBUTING.md
CeleritasCelery Jul 11, 2022
8a801c7
Auto merge of #9154 - CeleritasCelery:master, r=flip1995
bors Jul 11, 2022
9225ebd
lower let-else in MIR instead
dingxiangfei2009 Jun 2, 2022
af3ba22
move else block into the `Local` struct
dingxiangfei2009 Jul 5, 2022
3206fb4
Auto merge of #9138 - Jarcho:branches_sharing_code_2, r=giraffate
bors Jul 12, 2022
134d0de
declare span variable before call
kyoto7250 Jul 12, 2022
eabad8e
Auto merge of #9149 - kyoto7250:issue_9013, r=Jarcho
bors Jul 12, 2022
9d86ce6
add new rval, pull deref early
ouz-a Jun 13, 2022
8878d67
Lint for repeated traits within trait bounds or where clauses.
Apr 12, 2022
7f4e5d8
update pull request template
Rqnsom Jul 12, 2022
9ebacd4
Auto merge of #8703 - aldhsu:add_repeated_where_clause_or_trait_bound…
bors Jul 12, 2022
07ab0e8
Auto merge of #9157 - Rqnsom:pull_request_template, r=flip1995
bors Jul 12, 2022
1c3f62c
Fix clippy build
WaffleLapkin Jun 30, 2022
c26188e
Moves format_push_string to pedantic.
Victor-N-Suadicani Jul 12, 2022
852c38c
fix for manual_flatten help texts order
Rqnsom Jul 11, 2022
9e2f689
Rollup merge of #98848 - flip1995:clippy-book, r=jyn514
GuillaumeGomez Jul 13, 2022
565d3fd
Move to restriction
Victor-N-Suadicani Jul 13, 2022
dcd2484
Clippy fallout.
cjgillot Jun 4, 2022
f78292a
Auto merge of #9156 - Rqnsom:manual_flatten, r=Alexendoo
bors Jul 13, 2022
9e1af3f
Rollup merge of #98574 - dingxiangfei2009:let-else-thir, r=oli-obk
Dylan-DPC Jul 13, 2022
73a6240
Rollup merge of #99011 - oli-obk:UnsoundCell, r=eddyb
Dylan-DPC Jul 13, 2022
018684d
Use LazyLock for lint_message_convention regexes
Alexendoo Jul 13, 2022
44be2d4
Auto merge of #9169 - Alexendoo:message-convention-regex, r=flip1995
bors Jul 13, 2022
4e3a7bf
Auto merge of #98145 - ouz-a:some_branch, r=oli-obk
bors Jul 13, 2022
0930ac9
Fix typos
bors Jul 13, 2022
0db9280
Auto merge of #9159 - alex-semenyuk:fix_typos, r=dswij
bors Jul 13, 2022
467e1b2
box_collection: raise warn for all std collections
Rqnsom Jul 13, 2022
a7162f2
Auto merge of #9134 - Jarcho:while_let_iter_closure, r=dswij
bors Jul 13, 2022
5b7a2d5
Auto merge of #99210 - Dylan-DPC:rollup-879cp1t, r=Dylan-DPC
bors Jul 13, 2022
08431cd
Update highlight.js
Serial-ATA May 17, 2022
eee0bf4
add array tests, cleanup, tidy, and bless
RalfJung Jun 30, 2022
73f3294
Rename `debugging_opts` to `unstable_opts`
jyn514 Jul 6, 2022
7fbaf81
Fix the minimal version for `clap`
giraffate Jul 14, 2022
44f25ba
Auto merge of #98975 - jyn514:unstable_opts, r=wesleywiser
bors Jul 14, 2022
1b23c0e
Auto merge of #9173 - giraffate:fix_the_minimal_version_for_clap, r=x…
bors Jul 14, 2022
5a6fe3f
Rollup merge of #97720 - cjgillot:all-fresh, r=petrochenkov
Dylan-DPC Jul 14, 2022
e275abf
Rollup merge of #98705 - WaffleLapkin:closure_binder, r=cjgillot
Dylan-DPC Jul 14, 2022
c9a78ee
Auto merge of #99231 - Dylan-DPC:rollup-0tl8c0o, r=Dylan-DPC
bors Jul 14, 2022
43ac256
Add Known problems section
Victor-N-Suadicani Jul 14, 2022
10e85ef
Auto merge of #9161 - Victor-N-Suadicani:move_format_push_string_to_p…
bors Jul 14, 2022
0f5a38f
Auto merge of #9170 - Rqnsom:box_collection, r=Jarcho
bors Jul 14, 2022
6dc9746
Auto merge of #95956 - yaahc:stable-in-unstable, r=cjgillot
bors Jul 14, 2022
2f825db
std_instead_of_core, std_instead_of_alloc, alloc_instead_of_core
i509VCB Jul 2, 2022
2894df3
match_like_matches_macro does not trigger when one arm contains conta…
alex-semenyuk Jul 15, 2022
f074034
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Jul 15, 2022
9178ba1
Bump nightly version -> 2022-07-15
flip1995 Jul 15, 2022
c9f0d1a
Auto merge of #9103 - i509VCB:std-instead-of-core, r=Manishearth
bors Jul 15, 2022
fe68145
Auto merge of #9174 - flip1995:rustup, r=Jarcho
bors Jul 15, 2022
aa0706b
Auto merge of #9178 - alex-semenyuk:match_like_matches_macro_fix, r=J…
bors Jul 15, 2022
b707a23
Rename rustcSource in contributing docs
Guilherme-Vasconcelos Jul 13, 2022
b1e2578
Auto merge of #9172 - Guilherme-Vasconcelos:master, r=flip1995
bors Jul 15, 2022
4562dd0
Auto merge of #9171 - Serial-ATA:highlight-js, r=xFrednet
bors Jul 16, 2022
e780435
NEEDLESS_OPTION_TAKE doc improvements
alex-semenyuk Jun 19, 2022
3a4e457
Auto merge of #9022 - alex-semenyuk:needless_option_take_more_docs, r…
bors Jul 17, 2022
142898e
Fix example for `clippy::invalid_regex`
alex-semenyuk Jul 17, 2022
fdb84cb
Auto merge of #9196 - alex-semenyuk:invalid_regex, r=Jarcho
bors Jul 17, 2022
7fab8a4
Merge commit 'fdb84cbfd25908df5683f8f62388f663d9260e39' into clippyup
flip1995 Jul 18, 2022
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: 8 additions & 4 deletions src/tools/clippy/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ Thank you for making Clippy better!
We're collecting our changelog from pull request descriptions.
If your PR only includes internal changes, you can just write
`changelog: none`. Otherwise, please write a short comment
explaining your change. Also, it's helpful for us that
the lint name is put into brackets `[]` and backticks `` ` ` ``,
e.g. ``[`lint_name`]``.
explaining your change.

If your PR fixes an issue, you can add "fixes #issue_number" into this
It's also helpful for us that the lint name is put within backticks (`` ` ` ``),
and then encapsulated by square brackets (`[]`), for example:
```
changelog: [`lint_name`]: your change
```

If your PR fixes an issue, you can add `fixes #issue_number` into this
PR description. This way the issue will be automatically closed when
your PR is merged.

Expand Down
6 changes: 3 additions & 3 deletions src/tools/clippy/.github/workflows/clippy_bors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
OS: ${{ runner.os }}

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

steps:
Expand Down Expand Up @@ -264,7 +264,7 @@ jobs:
name: bors test finished
if: github.event.pusher.name == 'bors' && success()
runs-on: ubuntu-latest
needs: [changelog, base, integration_build, integration]
needs: [changelog, base, metadata_collection, integration_build, integration]

steps:
- name: Mark the job as successful
Expand All @@ -274,7 +274,7 @@ jobs:
name: bors test finished
if: github.event.pusher.name == 'bors' && (failure() || cancelled())
runs-on: ubuntu-latest
needs: [changelog, base, integration_build, integration]
needs: [changelog, base, metadata_collection, integration_build, integration]

steps:
- name: Mark the job as a failure
Expand Down
175 changes: 168 additions & 7 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,173 @@
# Changelog

All notable changes to this project will be documented in this file.
See [Changelog Update](doc/changelog_update.md) if you want to update this
See [Changelog Update](book/src/development/infrastructure/changelog_update.md) if you want to update this
document.

## Unreleased / In Rust Nightly

[d0cf3481...master](https://github.com/rust-lang/rust-clippy/compare/d0cf3481...master)
[7c21f91b...master](https://github.com/rust-lang/rust-clippy/compare/7c21f91b...master)

## Rust 1.62

Current stable, released 2022-06-30

[d0cf3481...7c21f91b](https://github.com/rust-lang/rust-clippy/compare/d0cf3481...7c21f91b)

### New Lints

* [`large_include_file`]
[#8727](https://github.com/rust-lang/rust-clippy/pull/8727)
* [`cast_abs_to_unsigned`]
[#8635](https://github.com/rust-lang/rust-clippy/pull/8635)
* [`err_expect`]
[#8606](https://github.com/rust-lang/rust-clippy/pull/8606)
* [`unnecessary_owned_empty_strings`]
[#8660](https://github.com/rust-lang/rust-clippy/pull/8660)
* [`empty_structs_with_brackets`]
[#8594](https://github.com/rust-lang/rust-clippy/pull/8594)
* [`crate_in_macro_def`]
[#8576](https://github.com/rust-lang/rust-clippy/pull/8576)
* [`needless_option_take`]
[#8665](https://github.com/rust-lang/rust-clippy/pull/8665)
* [`bytes_count_to_len`]
[#8711](https://github.com/rust-lang/rust-clippy/pull/8711)
* [`is_digit_ascii_radix`]
[#8624](https://github.com/rust-lang/rust-clippy/pull/8624)
* [`await_holding_invalid_type`]
[#8707](https://github.com/rust-lang/rust-clippy/pull/8707)
* [`trim_split_whitespace`]
[#8575](https://github.com/rust-lang/rust-clippy/pull/8575)
* [`pub_use`]
[#8670](https://github.com/rust-lang/rust-clippy/pull/8670)
* [`format_push_string`]
[#8626](https://github.com/rust-lang/rust-clippy/pull/8626)
* [`empty_drop`]
[#8571](https://github.com/rust-lang/rust-clippy/pull/8571)
* [`drop_non_drop`]
[#8630](https://github.com/rust-lang/rust-clippy/pull/8630)
* [`forget_non_drop`]
[#8630](https://github.com/rust-lang/rust-clippy/pull/8630)

### Moves and Deprecations

* Move [`only_used_in_recursion`] to `nursery` (now allow-by-default)
[#8783](https://github.com/rust-lang/rust-clippy/pull/8783)
* Move [`stable_sort_primitive`] to `pedantic` (now allow-by-default)
[#8716](https://github.com/rust-lang/rust-clippy/pull/8716)

### Enhancements

* Remove overlap between [`manual_split_once`] and [`needless_splitn`]
[#8631](https://github.com/rust-lang/rust-clippy/pull/8631)
* [`map_identity`]: Now checks for needless `map_err`
[#8487](https://github.com/rust-lang/rust-clippy/pull/8487)
* [`extra_unused_lifetimes`]: Now checks for impl lifetimes
[#8737](https://github.com/rust-lang/rust-clippy/pull/8737)
* [`cast_possible_truncation`]: Now catches more cases with larger shift or divide operations
[#8687](https://github.com/rust-lang/rust-clippy/pull/8687)
* [`identity_op`]: Now checks for modulo expressions
[#8519](https://github.com/rust-lang/rust-clippy/pull/8519)
* [`panic`]: No longer lint in constant context
[#8592](https://github.com/rust-lang/rust-clippy/pull/8592)
* [`manual_split_once`]: Now lints manual iteration of `splitn`
[#8717](https://github.com/rust-lang/rust-clippy/pull/8717)
* [`self_named_module_files`], [`mod_module_files`]: Now handle relative module paths
[#8611](https://github.com/rust-lang/rust-clippy/pull/8611)
* [`unsound_collection_transmute`]: Now has better size and alignment checks
[#8648](https://github.com/rust-lang/rust-clippy/pull/8648)
* [`unnested_or_patterns`]: Ignore cases, where the suggestion would be longer
[#8619](https://github.com/rust-lang/rust-clippy/pull/8619)

### False Positive Fixes

* [`rest_pat_in_fully_bound_structs`]: Now ignores structs marked with `#[non_exhaustive]`
[#8690](https://github.com/rust-lang/rust-clippy/pull/8690)
* [`needless_late_init`]: No longer lints `if let` statements, `let mut` bindings or instances that
changes the drop order significantly
[#8617](https://github.com/rust-lang/rust-clippy/pull/8617)
* [`unnecessary_cast`]: No longer lints to casts to aliased or non-primitive types
[#8596](https://github.com/rust-lang/rust-clippy/pull/8596)
* [`init_numbered_fields`]: No longer lints type aliases
[#8780](https://github.com/rust-lang/rust-clippy/pull/8780)
* [`needless_option_as_deref`]: No longer lints for `as_deref_mut` on `Option` values that can't be moved
[#8646](https://github.com/rust-lang/rust-clippy/pull/8646)
* [`mistyped_literal_suffixes`]: Now ignores float literals without an exponent
[#8742](https://github.com/rust-lang/rust-clippy/pull/8742)
* [`undocumented_unsafe_blocks`]: Now ignores unsafe blocks from proc-macros and works better for sub-expressions
[#8450](https://github.com/rust-lang/rust-clippy/pull/8450)
* [`same_functions_in_if_condition`]: Now allows different constants, even if they have the same value
[#8673](https://github.com/rust-lang/rust-clippy/pull/8673)
* [`needless_match`]: Now checks for more complex types and ignores type coercion
[#8549](https://github.com/rust-lang/rust-clippy/pull/8549)
* [`assertions_on_constants`]: Now ignores constants from `cfg!` macros
[#8614](https://github.com/rust-lang/rust-clippy/pull/8614)
* [`indexing_slicing`]: Fix false positives with constant indices in
[#8588](https://github.com/rust-lang/rust-clippy/pull/8588)
* [`iter_with_drain`]: Now ignores iterator references
[#8668](https://github.com/rust-lang/rust-clippy/pull/8668)
* [`useless_attribute`]: Now allows [`redundant_pub_crate`] on `use` items
[#8743](https://github.com/rust-lang/rust-clippy/pull/8743)
* [`cast_ptr_alignment`]: Now ignores expressions, when used for unaligned reads and writes
[#8632](https://github.com/rust-lang/rust-clippy/pull/8632)
* [`wrong_self_convention`]: Now allows `&mut self` and no self as arguments for `is_*` methods
[#8738](https://github.com/rust-lang/rust-clippy/pull/8738)
* [`mut_from_ref`]: Only lint in unsafe code
[#8647](https://github.com/rust-lang/rust-clippy/pull/8647)
* [`redundant_pub_crate`]: Now allows macro exports
[#8736](https://github.com/rust-lang/rust-clippy/pull/8736)
* [`needless_match`]: Ignores cases where the else block expression is different
[#8700](https://github.com/rust-lang/rust-clippy/pull/8700)
* [`transmute_int_to_char`]: Now allows transmutations in `const` code
[#8610](https://github.com/rust-lang/rust-clippy/pull/8610)
* [`manual_non_exhaustive`]: Ignores cases, where the enum value is used
[#8645](https://github.com/rust-lang/rust-clippy/pull/8645)
* [`redundant_closure`]: Now ignores coerced closure
[#8431](https://github.com/rust-lang/rust-clippy/pull/8431)
* [`identity_op`]: Is now ignored in cases where extra brackets would be needed
[#8730](https://github.com/rust-lang/rust-clippy/pull/8730)
* [`let_unit_value`]: Now ignores cases which are used for type inference
[#8563](https://github.com/rust-lang/rust-clippy/pull/8563)

### Suggestion Fixes/Improvements

* [`manual_split_once`]: Fixed incorrect suggestions for single result accesses
[#8631](https://github.com/rust-lang/rust-clippy/pull/8631)
* [`bytes_nth`]: Fix typos in the diagnostic message
[#8403](https://github.com/rust-lang/rust-clippy/pull/8403)
* [`mistyped_literal_suffixes`]: Now suggests the correct integer types
[#8742](https://github.com/rust-lang/rust-clippy/pull/8742)
* [`unnecessary_to_owned`]: Fixed suggestion based on the configured msrv
[#8692](https://github.com/rust-lang/rust-clippy/pull/8692)
* [`single_element_loop`]: Improve lint for Edition 2021 arrays
[#8616](https://github.com/rust-lang/rust-clippy/pull/8616)
* [`manual_bits`]: Now includes a cast for proper type conversion, when needed
[#8677](https://github.com/rust-lang/rust-clippy/pull/8677)
* [`option_map_unit_fn`], [`result_map_unit_fn`]: Fix some incorrect suggestions
[#8584](https://github.com/rust-lang/rust-clippy/pull/8584)
* [`collapsible_else_if`]: Add whitespace in suggestion
[#8729](https://github.com/rust-lang/rust-clippy/pull/8729)
* [`transmute_bytes_to_str`]: Now suggest `from_utf8_unchecked` in `const` context
[#8612](https://github.com/rust-lang/rust-clippy/pull/8612)
* [`map_clone`]: Improve message and suggestion based on the msrv
[#8688](https://github.com/rust-lang/rust-clippy/pull/8688)
* [`needless_late_init`]: Now shows the `let` statement where it was first initialized
[#8779](https://github.com/rust-lang/rust-clippy/pull/8779)

### ICE Fixes

* [`only_used_in_recursion`]
[#8691](https://github.com/rust-lang/rust-clippy/pull/8691)
* [`cast_slice_different_sizes`]
[#8720](https://github.com/rust-lang/rust-clippy/pull/8720)
* [`iter_overeager_cloned`]
[#8602](https://github.com/rust-lang/rust-clippy/pull/8602)
* [`undocumented_unsafe_blocks`]
[#8686](https://github.com/rust-lang/rust-clippy/pull/8686)

## Rust 1.61

Current stable, released 2022-05-19
Released 2022-05-19

[57b3c4b...d0cf3481](https://github.com/rust-lang/rust-clippy/compare/57b3c4b...d0cf3481)

Expand Down Expand Up @@ -207,7 +364,7 @@ Released 2022-04-07

* [`needless_borrow`]: Prevent mutable borrows being moved and suggest removing the borrow on method calls
[#8217](https://github.com/rust-lang/rust-clippy/pull/8217)
* [`chars_next_cmp`]: Correctly excapes the suggestion
* [`chars_next_cmp`]: Correctly escapes the suggestion
[#8376](https://github.com/rust-lang/rust-clippy/pull/8376)
* [`explicit_write`]: Add suggestions for `write!`s with format arguments
[#8365](https://github.com/rust-lang/rust-clippy/pull/8365)
Expand Down Expand Up @@ -1420,7 +1577,7 @@ Released 2021-03-25
* Add `cargo dev-lintcheck` tool to the Clippy Dev Tool
[#6469](https://github.com/rust-lang/rust-clippy/pull/6469)

[Roadmap]: https://github.com/rust-lang/rust-clippy/blob/master/doc/roadmap-2021.md
[Roadmap]: https://github.com/rust-lang/rust-clippy/blob/master/book/src/development/proposals/roadmap-2021.md
[Roadmap project page]: https://github.com/rust-lang/rust-clippy/projects/3

## Rust 1.50
Expand Down Expand Up @@ -2368,7 +2525,7 @@ Released 2019-09-26
* [`inherent_to_string_shadow_display`] [#4259](https://github.com/rust-lang/rust-clippy/pull/4259)
* [`type_repetition_in_bounds`] [#3766](https://github.com/rust-lang/rust-clippy/pull/3766)
* [`try_err`] [#4222](https://github.com/rust-lang/rust-clippy/pull/4222)
* Move `{unnnecessary,panicking}_unwrap` out of nursery [#4307](https://github.com/rust-lang/rust-clippy/pull/4307)
* Move `{unnecessary,panicking}_unwrap` out of nursery [#4307](https://github.com/rust-lang/rust-clippy/pull/4307)
* Extend the `use_self` lint to suggest uses of `Self::Variant` [#4308](https://github.com/rust-lang/rust-clippy/pull/4308)
* Improve suggestion for needless return [#4262](https://github.com/rust-lang/rust-clippy/pull/4262)
* Add auto-fixable suggestion for `let_unit` [#4337](https://github.com/rust-lang/rust-clippy/pull/4337)
Expand Down Expand Up @@ -3269,12 +3426,13 @@ Released 2018-09-13
[`AsRef`]: https://doc.rust-lang.org/std/convert/trait.AsRef.html
[configuration file]: ./rust-clippy#configuration
[pull3665]: https://github.com/rust-lang/rust-clippy/pull/3665
[adding_lints]: https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md
[adding_lints]: https://github.com/rust-lang/rust-clippy/blob/master/book/src/development/adding_lints.md
[`README.md`]: https://github.com/rust-lang/rust-clippy/blob/master/README.md

<!-- lint disable no-unused-definitions -->
<!-- begin autogenerated links to lint list -->
[`absurd_extreme_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#absurd_extreme_comparisons
[`alloc_instead_of_core`]: https://rust-lang.github.io/rust-clippy/master/index.html#alloc_instead_of_core
[`allow_attributes_without_reason`]: https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes_without_reason
[`almost_complete_letter_range`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_complete_letter_range
[`almost_swapped`]: https://rust-lang.github.io/rust-clippy/master/index.html#almost_swapped
Expand Down Expand Up @@ -3484,6 +3642,7 @@ Released 2018-09-13
[`invalid_ref`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_ref
[`invalid_regex`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_regex
[`invalid_upcast_comparisons`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_upcast_comparisons
[`invalid_utf8_in_unchecked`]: https://rust-lang.github.io/rust-clippy/master/index.html#invalid_utf8_in_unchecked
[`invisible_characters`]: https://rust-lang.github.io/rust-clippy/master/index.html#invisible_characters
[`is_digit_ascii_radix`]: https://rust-lang.github.io/rust-clippy/master/index.html#is_digit_ascii_radix
[`items_after_statements`]: https://rust-lang.github.io/rust-clippy/master/index.html#items_after_statements
Expand Down Expand Up @@ -3743,6 +3902,8 @@ Released 2018-09-13
[`skip_while_next`]: https://rust-lang.github.io/rust-clippy/master/index.html#skip_while_next
[`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
[`std_instead_of_core`]: https://rust-lang.github.io/rust-clippy/master/index.html#std_instead_of_core
[`str_to_string`]: https://rust-lang.github.io/rust-clippy/master/index.html#str_to_string
[`string_add`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_add
[`string_add_assign`]: https://rust-lang.github.io/rust-clippy/master/index.html#string_add_assign
Expand Down
7 changes: 3 additions & 4 deletions src/tools/clippy/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ All contributors are expected to follow the [Rust Code of Conduct].
- [The Clippy book](#the-clippy-book)
- [High level approach](#high-level-approach)
- [Finding something to fix/improve](#finding-something-to-fiximprove)
- [Writing code](#writing-code)
- [Getting code-completion for rustc internals to work](#getting-code-completion-for-rustc-internals-to-work)
- [IntelliJ Rust](#intellij-rust)
- [Rust Analyzer](#rust-analyzer)
Expand Down Expand Up @@ -115,11 +114,11 @@ As of [#6869][6869], [`rust-analyzer`][ra_homepage] can understand that Clippy u
using `extern crate` when `package.metadata.rust-analyzer.rustc_private` is set to `true` in Clippy's `Cargo.toml.`
You will require a `nightly` toolchain with the `rustc-dev` component installed.
Make sure that in the `rust-analyzer` configuration, you set
```
{ "rust-analyzer.rustcSource": "discover" }
```json
{ "rust-analyzer.rustc.source": "discover" }
```
and
```
```json
{ "rust-analyzer.updates.channel": "nightly" }
```
You should be able to see information on things like `Expr` or `EarlyContext` now if you hover them, also
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Clippy Book

This is the source for the Clippy Book. See the
[book](src/infrastructure/book.md) for more information.
[book](src/development/infrastructure/book.md) for more information.
10 changes: 7 additions & 3 deletions src/tools/clippy/book/src/development/basics.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ This document explains the basics for hacking on Clippy. Besides others, this
includes how to build and test Clippy. For a more in depth description on the
codebase take a look at [Adding Lints] or [Common Tools].

[Adding Lints]: https://github.com/rust-lang/rust-clippy/blob/master/doc/adding_lints.md
[Common Tools]: https://github.com/rust-lang/rust-clippy/blob/master/doc/common_tools_writing_lints.md
[Adding Lints]: https://github.com/rust-lang/rust-clippy/blob/master/book/src/development/adding_lints.md
[Common Tools]: https://github.com/rust-lang/rust-clippy/blob/master/book/src/development/common_tools_writing_lints.md

- [Basics for hacking on Clippy](#basics-for-hacking-on-clippy)
- [Get the Code](#get-the-code)
Expand Down Expand Up @@ -59,7 +59,7 @@ cargo uitest
# only run UI tests starting with `test_`
TESTNAME="test_" cargo uitest
# only run dogfood tests
cargo test --test dogfood
cargo dev dogfood
```

If the output of a [UI test] differs from the expected output, you can update
Expand Down Expand Up @@ -91,10 +91,14 @@ cargo dev fmt
cargo dev update_lints
# create a new lint and register it
cargo dev new_lint
# deprecate a lint and attempt to remove code relating to it
cargo dev deprecate
# automatically formatting all code before each commit
cargo dev setup git-hook
# (experimental) Setup Clippy to work with IntelliJ-Rust
cargo dev setup intellij
# runs the `dogfood` tests
cargo dev dogfood
```

More about intellij command usage and reasons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ As section headers, we use:
Please also be sure to update the Beta/Unreleased sections at the top with the
relevant commit ranges.

If you have the time, it would be appreciated if you double-check, that the
`#[clippy::version]` attributes for the added lints contains the correct version.

[changelog]: https://github.com/rust-lang/rust-clippy/blob/master/CHANGELOG.md
[forge]: https://forge.rust-lang.org/
[rust_master_tools]: https://github.com/rust-lang/rust/tree/master/src/tools/clippy
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/book/src/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ For more information on configuring lint levels, see the [rustc documentation].
Clippy has lint groups which are allow-by-default. This means, that you will
have to enable the lints in those groups manually.

For a full list of all lints with their description and examples, please refere
For a full list of all lints with their description and examples, please refer
to [Clippy's lint list]. The two most important allow-by-default groups are
described below:

Expand Down
33 changes: 33 additions & 0 deletions src/tools/clippy/clippy_dev/src/dogfood.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use crate::clippy_project_root;
use std::process::Command;

/// # Panics
///
/// Panics if unable to run the dogfood test
pub fn dogfood(fix: bool, allow_dirty: bool, allow_staged: bool) {
let mut cmd = Command::new("cargo");

cmd.current_dir(clippy_project_root())
.args(["test", "--test", "dogfood"])
.args(["--features", "internal"])
.args(["--", "dogfood_clippy"]);

let mut dogfood_args = Vec::new();
if fix {
dogfood_args.push("--fix");
}

if allow_dirty {
dogfood_args.push("--allow-dirty");
}

if allow_staged {
dogfood_args.push("--allow-staged");
}

cmd.env("__CLIPPY_DOGFOOD_ARGS", dogfood_args.join(" "));

let output = cmd.output().expect("failed to run command");

println!("{}", String::from_utf8_lossy(&output.stdout));
}
Loading