Skip to content

Update Clippy #89328

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 116 commits into from
Sep 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
116 commits
Select commit Hold shift + click to select a range
c0e0171
Rename two lints to comply with our lint naming convention
flip1995 Jul 29, 2021
74d1561
Auto merge of #7505 - flip1995:beta, r=flip1995
bors Jul 29, 2021
48268f5
fix(clippy): update loop lints to use arg.span
notriddle Sep 7, 2021
06ae9e4
Move the dataflow framework to its own crate.
cjgillot Jan 5, 2021
98e8682
Rename rustc_mir to rustc_const_eval.
cjgillot Jan 5, 2021
091ed44
Merge commit '27afd6ade4bb1123a8bf82001629b69d23d62aff' into clippyup
flip1995 Sep 8, 2021
7f1c2c0
Add target to cargo config
camsteffen Sep 8, 2021
cea46dd
Use relative deps path
camsteffen Sep 8, 2021
2e15c80
Make host libs -L flag optional
camsteffen Sep 8, 2021
e3b171d
Use relative exe paths
camsteffen Sep 8, 2021
ecaf7ac
Use relative path for test builds
camsteffen Sep 8, 2021
1074bad
Rename test_build_base to test
camsteffen Sep 8, 2021
5250744
Remove target dir from aliases
camsteffen Sep 8, 2021
9e08e7f
Remove special dogfood target
camsteffen Sep 8, 2021
261e34d
Auto merge of #88615 - flip1995:clippyup, r=Manishearth
bors Sep 8, 2021
293db0d
Allow giving reasons for disallowed_methods
azdavis Sep 9, 2021
8f88acd
add new lint `iter_not_returning_iterator`
Labelray Sep 7, 2021
36e6469
Auto merge of #7621 - azdavis:master, r=camsteffen
bors Sep 9, 2021
1a52478
Auto merge of #7610 - Labelray:master, r=camsteffen
bors Sep 9, 2021
ccc087e
Prep for upgrade to cargo_metadata 0.14.0
smoelius Sep 1, 2021
43ed206
Update dependencies
smoelius Sep 9, 2021
f402ede
Merge remote-tracking branch 'upstream/beta' into backport_remerge
flip1995 Sep 9, 2021
d5595e5
Auto merge of #7649 - flip1995:backport_remerge, r=flip1995
bors Sep 9, 2021
81ce2fb
Ignore automatically derived impls of `Clone` and `Debug` in dead cod…
FabianWolff May 21, 2021
5782dc0
Fix redundant closure bugs
camsteffen Sep 9, 2021
ae2a95f
Eat dogfood
camsteffen Sep 9, 2021
5aff720
fix derivable impl false positives
HKalbasi Sep 10, 2021
e8cd4e5
Auto merge of #7660 - HKalbasi:derivable-impls, r=camsteffen
bors Sep 10, 2021
4c1b6a2
Fix result order for `manual_split_once` when `rsplitn` is used
Jarcho Sep 10, 2021
11e2966
Keep a parent LocalDefId in SpanData.
cjgillot Apr 18, 2021
9163ac9
rustc: Remove local variable IDs from `Export`s
petrochenkov Sep 5, 2021
eac0b26
Auto merge of #88214 - notriddle:notriddle/for-loop-span-drop-temps-m…
bors Sep 11, 2021
2636a1b
Auto merge of #7663 - Jarcho:rsplit_once_order, r=llogiq
bors Sep 11, 2021
ce1da84
Rebase fallout.
cjgillot Sep 10, 2021
e6455ea
Auto merge of #84373 - cjgillot:resolve-span, r=michaelwoerister,petr…
bors Sep 11, 2021
6da1461
Rollup merge of #88677 - petrochenkov:exportid, r=davidtwco
Manishearth Sep 12, 2021
5d93d9d
Introduce NullOp::AlignOf
nbdd0121 Sep 7, 2021
00d45fe
Auto merge of #88839 - nbdd0121:alignof, r=nagisa
bors Sep 12, 2021
a64b769
Auto merge of #7661 - camsteffen:eta, r=giraffate
bors Sep 13, 2021
1add837
Auto merge of #88517 - smoelius:without-patch-versions, r=flip1995
bors Sep 13, 2021
6b4b77a
Update test for needless-borrow FP for mutable ref
dswij Sep 9, 2021
46c3076
Fix `needless_borrow` not linting mutable reference
dswij Sep 9, 2021
81d57de
Update `needless_borrow` test output and expected fix
dswij Sep 9, 2021
b556398
Auto merge of #7646 - camsteffen:relative-target, r=flip1995
bors Sep 13, 2021
e009073
Fix FP when using raw pointers as hashed keys
kneasle Sep 5, 2021
d37f109
Update permissions path for clippy lint
GuillaumeGomez Sep 13, 2021
e2cdaec
same_name_method
lengyijun Sep 8, 2021
d23994d
Updating issue templates to avoid @rustbot triggers
xFrednet Sep 14, 2021
7680c9b
Auto merge of #7670 - xFrednet:0000-lets-hope-this-fixes-rustbot-fps,…
bors Sep 14, 2021
b2ffb28
Fix FN for collections/smart ptrs in `std`
kneasle Sep 8, 2021
746a005
Auto merge of #7640 - kneasle:mut-key-false-positive, r=camsteffen
bors Sep 14, 2021
c2783c1
Downgrade many_single_char_names to pedantic
dtolnay Sep 14, 2021
2316f4d
Auto merge of #7671 - dtolnay-contrib:singlecharnames, r=xFrednet
bors Sep 14, 2021
2a9a9ca
Fix clippy
jackh726 Sep 16, 2021
fb78365
add 3414 test
lengyijun Sep 16, 2021
f99b4ad
Auto merge of #7678 - lengyijun:issue3414, r=giraffate
bors Sep 17, 2021
ed7a82e
Auto merge of #7653 - lengyijun:same_name_method_crate, r=llogiq
bors Sep 17, 2021
59cd777
Auto merge of #7657 - dswij:needless-borrow-mut, r=llogiq
bors Sep 17, 2021
ee6a6b5
Change the suggestion for `while_let_on_iterator` when the iterator c…
Jarcho Sep 18, 2021
b365912
Fix needless_return with let-else
camsteffen Sep 18, 2021
19a3116
Remove needless hir Map ref
camsteffen Sep 18, 2021
871ad80
Auto merge of #7690 - Jarcho:while_loop_by_ref, r=xFrednet
bors Sep 19, 2021
44b8301
Do not store visibility in *ItemRef.
cjgillot Jul 15, 2021
63ed2f9
Expand BOX_VEC to BOX_COLLECTION
F3real Sep 17, 2021
ede8679
Enable 2021 compatibility lints for all in-tree code
Mark-Simulacrum Sep 18, 2021
41fe546
Retry on some download errors in lintcheck
Jarcho Sep 20, 2021
7f96b35
Register lint rename
F3real Sep 20, 2021
1183371
Remove Drop-caused migration-added captures
Mark-Simulacrum Sep 19, 2021
4873ebe
Use ZST for fmt unsafety
camsteffen Sep 21, 2021
848e551
Auto merge of #7694 - Jarcho:lintcheck_retry, r=matthiaskrgr
bors Sep 21, 2021
3ad3c51
Demote float_cmp to pedantic
workingjubilee Sep 19, 2021
a3b67fe
Auto merge of #89103 - Mark-Simulacrum:migrate-2021, r=estebank
bors Sep 21, 2021
ac9e80e
Rollup merge of #89078 - camsteffen:map-ref, r=cjgillot
the8472 Sep 21, 2021
b51b172
Auto merge of #89158 - the8472:rollup-3e4ijth, r=the8472
bors Sep 21, 2021
8a75002
Auto merge of #7685 - camsteffen:let-else-needless-ret, r=giraffate
bors Sep 22, 2021
b68325e
add #4546 test
lengyijun Sep 17, 2021
a4a8ec2
Auto merge of #7679 - lengyijun:issue4546, r=xFrednet
bors Sep 22, 2021
27bb76b
Tweak pedantic description for occasional FPs
camsteffen Sep 22, 2021
3cd54ba
Auto merge of #7704 - camsteffen:pedantic-occasional, r=Manishearth
bors Sep 22, 2021
bb971e0
Add missing reference to box_vec
F3real Sep 22, 2021
ef2e2f0
Auto merge of #7693 - F3real:vec2, r=Manishearth
bors Sep 22, 2021
edaeacf
Auto merge of #89139 - camsteffen:write-perf, r=Mark-Simulacrum
bors Sep 23, 2021
5efd6bc
Don't lint `suspicious_else_formatting` inside proc-macros
Jarcho Sep 23, 2021
e69154f
Add test for #7650
Jarcho Sep 23, 2021
cd3f3cf
Auto merge of #7707 - Jarcho:suspicious_else_proc_mac, r=Manishearth
bors Sep 23, 2021
7a4a556
Avoid needless heap allocation in box_collection
F3real Sep 24, 2021
7355376
consistent big O notation
wooster0 Sep 24, 2021
543b638
Add new lint `if_then_panic`
Labelray Sep 14, 2021
2e38bc1
Auto merge of #7715 - F3real:vec2, r=camsteffen
bors Sep 24, 2021
fb61d04
Auto merge of #7669 - Labelray:if_then_panic, r=giraffate
bors Sep 24, 2021
e0b68ae
Rollup merge of #89001 - jackh726:binder-cleanup, r=nikomatsakis
workingjubilee Sep 24, 2021
fc8edf1
Introduce `Rvalue::ShallowInitBox`
nbdd0121 Sep 6, 2021
aef4577
Auto merge of #89030 - nbdd0121:box2, r=jonas-schievink
bors Sep 25, 2021
c3515c3
bump clippy crates to edition 2021
matthiaskrgr Sep 10, 2021
d888b4b
clippy lints: update doctest ranges to inclusive ones
matthiaskrgr Sep 10, 2021
067bfe3
Rollup merge of #89216 - r00ster91:bigo, r=dtolnay
Manishearth Sep 26, 2021
e63d692
Stop suggesting a float truncation that is not shorter
dtolnay Sep 26, 2021
30fe4ba
Auto merge of #7722 - dtolnay-contrib:float, r=giraffate
bors Sep 27, 2021
f100159
Auto merge of #7692 - workingjubilee:float-cmp-not-wrong, r=giraffate
bors Sep 27, 2021
0c8799d
Auto merge of #7664 - matthiaskrgr:bump_to_2021, r=flip1995
bors Sep 27, 2021
46f8aa9
Update changelog to 1.56
flip1995 Sep 27, 2021
b7d40bc
Adding new linting
andrewpollack Aug 30, 2021
9a3ccd8
Removed value from changelog to get pass
andrewpollack Sep 21, 2021
b6ffb29
Adjusting changelog
andrewpollack Sep 25, 2021
baec67e
Use a single if_chain
Manishearth Sep 28, 2021
17155c8
Add renamed lint
Manishearth Sep 28, 2021
13834e6
fmt
Manishearth Sep 28, 2021
cbf27d0
Auto merge of #7608 - andrewpollack:7594/while_let_some_result, r=Man…
bors Sep 28, 2021
707494e
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Sep 28, 2021
7f11e5a
Fix CHANGELOG formatting
flip1995 Sep 28, 2021
08cead3
Auto merge of #7727 - flip1995:changelog, r=xFrednet
bors Sep 28, 2021
ec38746
Allow internal lint INVALID_PATHS for itertools path
flip1995 Sep 28, 2021
d8f453d
Bump nightly version -> 2021-09-28
flip1995 Sep 28, 2021
c2b8882
Cleanup of rustup changes
flip1995 Sep 28, 2021
cb7915b
Auto merge of #7733 - flip1995:rustup, r=flip1995
bors Sep 28, 2021
d0fb9db
Merge commit 'cb7915b00c235e9b5861564f3be78dba330980ee' into clippyup
flip1995 Sep 28, 2021
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
5 changes: 3 additions & 2 deletions src/tools/clippy/.cargo/config
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
[alias]
uitest = "test --test compile-test"
dev = "run --target-dir clippy_dev/target --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
lintcheck = "run --target-dir lintcheck/target --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
dev = "run --package clippy_dev --bin clippy_dev --manifest-path clippy_dev/Cargo.toml --"
lintcheck = "run --package lintcheck --bin lintcheck --manifest-path lintcheck/Cargo.toml -- "
collect-metadata = "test --test dogfood --features metadata-collector-lint -- run_metadata_collection_lint --ignored"

[build]
# -Zbinary-dep-depinfo allows us to track which rlib files to use for compiling UI tests
rustflags = ["-Zunstable-options", "-Zbinary-dep-depinfo"]
target-dir = "target"
2 changes: 1 addition & 1 deletion src/tools/clippy/.github/ISSUE_TEMPLATE/blank_issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ about: Create a blank issue.
Additional labels can be added to this issue by including the following command
(without the space after the @ symbol):

`@rustbot label +<label>`
@ rustbot label +<label>

Common labels for this issue type are:
* C-an-interesting-project
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/.github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ LLVM version: 10.0
Additional labels can be added to this issue by including the following command
(without the space after the @ symbol):

`@rustbot label +<label>`
@ rustbot label +<label>

Common labels for this issue type are:
* `I-suggestion-causes-error`
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/.github/ISSUE_TEMPLATE/false_positive.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ LLVM version: 10.0
Additional labels can be added to this issue by including the following command
(without the space after the @ symbol):

`@rustbot label +<label>`
@ rustbot label +<label>

Common labels for this issue type are:
* I-suggestion-causes-error
Expand Down
99 changes: 80 additions & 19 deletions src/tools/clippy/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,81 @@ document.

## Unreleased / In Rust Nightly

[74d1561...master](https://github.com/rust-lang/rust-clippy/compare/74d1561...master)
[7bfc26e...master](https://github.com/rust-lang/rust-clippy/compare/7bfc26e...master)

## Rust 1.56

Current beta, release 2021-10-21

[74d1561...7bfc26e](https://github.com/rust-lang/rust-clippy/compare/74d1561...7bfc26e)

### New Lints

* [`unwrap_or_else_default`]
[#7516](https://github.com/rust-lang/rust-clippy/pull/7516)

### Enhancements

* [`needless_continue`]: Now also lints in `loop { continue; }` case
[#7477](https://github.com/rust-lang/rust-clippy/pull/7477)
* [`disallowed_type`]: Now also primitive types can be disallowed
[#7488](https://github.com/rust-lang/rust-clippy/pull/7488)
* [`manual_swap`]: Now also lints on xor swaps
[#7506](https://github.com/rust-lang/rust-clippy/pull/7506)
* [`map_flatten`]: Now also lints on the `Result` type
[#7522](https://github.com/rust-lang/rust-clippy/pull/7522)
* [`no_effect`]: Now also lints on inclusive ranges
[#7556](https://github.com/rust-lang/rust-clippy/pull/7556)

### False Positive Fixes

* [`nonstandard_macro_braces`]: No longer lints on similar named nested macros
[#7478](https://github.com/rust-lang/rust-clippy/pull/7478)
* [`too_many_lines`]: No longer lints in closures to avoid duplicated diagnostics
[#7534](https://github.com/rust-lang/rust-clippy/pull/7534)
* [`similar_names`]: No longer complains about `iter` and `item` being too
similar [#7546](https://github.com/rust-lang/rust-clippy/pull/7546)

### Suggestion Fixes/Improvements

* [`similar_names`]: No longer suggests to insert or add an underscore as a fix
[#7221](https://github.com/rust-lang/rust-clippy/pull/7221)
* [`new_without_default`]: No longer shows the full qualified type path when
suggesting adding a `Default` implementation
[#7493](https://github.com/rust-lang/rust-clippy/pull/7493)
* [`while_let_on_iterator`]: Now suggests re-borrowing mutable references
[#7520](https://github.com/rust-lang/rust-clippy/pull/7520)
* [`extend_with_drain`]: Improve code suggestion for mutable and immutable
references [#7533](https://github.com/rust-lang/rust-clippy/pull/7533)
* [`trivially_copy_pass_by_ref`]: Now properly handles `Self` type
[#7535](https://github.com/rust-lang/rust-clippy/pull/7535)
* [`never_loop`]: Now suggests using `if let` instead of a `for` loop when
applicable [#7541](https://github.com/rust-lang/rust-clippy/pull/7541)

### Documentation Improvements

* Clippy now uses a lint to generate its lint documentation. [Lints all the way
down](https://en.wikipedia.org/wiki/Turtles_all_the_way_down).
[#7502](https://github.com/rust-lang/rust-clippy/pull/7502)
* Reworked Clippy's website:
[#7172](https://github.com/rust-lang/rust-clippy/issues/7172)
[#7279](https://github.com/rust-lang/rust-clippy/pull/7279)
* Added applicability information about lints
* Added a link to jump into the implementation
* Improved loading times
* Adapted some styling
* `cargo clippy --help` now also explains the `--fix` and `--no-deps` flag
[#7492](https://github.com/rust-lang/rust-clippy/pull/7492)
* [`unnested_or_patterns`]: Removed `or_patterns` feature gate in the code
example [#7507](https://github.com/rust-lang/rust-clippy/pull/7507)

### New Lints

* Renamed Lint: `if_let_some_result` is now called [`match_result_ok`]. Now also handles `while let` case.

## Rust 1.55

Current beta, release 2021-09-09
Current stable, released 2021-09-09

[3ae8faf...74d1561](https://github.com/rust-lang/rust-clippy/compare/3ae8faf...74d1561)

Expand Down Expand Up @@ -126,21 +196,9 @@ Current beta, release 2021-09-09
* [`use_self`]
[#7428](https://github.com/rust-lang/rust-clippy/pull/7428)

### Documentation Improvements

* Reworked Clippy's website:
[#7279](https://github.com/rust-lang/rust-clippy/pull/7279)
[#7172](https://github.com/rust-lang/rust-clippy/issues/7172)
* Added applicability information about lints
* Added a link to jump into the implementation
* Improved loading times
* Adapted some styling
* Clippy now uses a lint to generate its documentation
[#7298](https://github.com/rust-lang/rust-clippy/pull/7298)

## Rust 1.54

Current stable, released 2021-07-29
Released 2021-07-29

[7c7683c...3ae8faf](https://github.com/rust-lang/rust-clippy/compare/7c7683c...3ae8faf)

Expand Down Expand Up @@ -1050,7 +1108,7 @@ Released 2020-11-19
[#5913](https://github.com/rust-lang/rust-clippy/pull/5913)
* Add example of false positive to [`ptr_arg`] docs.
[#5885](https://github.com/rust-lang/rust-clippy/pull/5885)
* [`box_vec`], [`vec_box`] and [`borrowed_box`]: add link to the documentation of `Box`
* [`box_vec`](https://rust-lang.github.io/rust-clippy/master/index.html#box_collection), [`vec_box`] and [`borrowed_box`]: add link to the documentation of `Box`
[#6023](https://github.com/rust-lang/rust-clippy/pull/6023)

## Rust 1.47
Expand Down Expand Up @@ -1491,7 +1549,7 @@ Released 2020-03-12
* `unknown_clippy_lints` [#4963](https://github.com/rust-lang/rust-clippy/pull/4963)
* [`explicit_into_iter_loop`] [#4978](https://github.com/rust-lang/rust-clippy/pull/4978)
* [`useless_attribute`] [#5022](https://github.com/rust-lang/rust-clippy/pull/5022)
* [`if_let_some_result`] [#5032](https://github.com/rust-lang/rust-clippy/pull/5032)
* `if_let_some_result` [#5032](https://github.com/rust-lang/rust-clippy/pull/5032)

### ICE fixes

Expand Down Expand Up @@ -2570,7 +2628,7 @@ Released 2018-09-13
[`bool_comparison`]: https://rust-lang.github.io/rust-clippy/master/index.html#bool_comparison
[`borrow_interior_mutable_const`]: https://rust-lang.github.io/rust-clippy/master/index.html#borrow_interior_mutable_const
[`borrowed_box`]: https://rust-lang.github.io/rust-clippy/master/index.html#borrowed_box
[`box_vec`]: https://rust-lang.github.io/rust-clippy/master/index.html#box_vec
[`box_collection`]: https://rust-lang.github.io/rust-clippy/master/index.html#box_collection
[`boxed_local`]: https://rust-lang.github.io/rust-clippy/master/index.html#boxed_local
[`branches_sharing_code`]: https://rust-lang.github.io/rust-clippy/master/index.html#branches_sharing_code
[`builtin_type_shadow`]: https://rust-lang.github.io/rust-clippy/master/index.html#builtin_type_shadow
Expand Down Expand Up @@ -2685,9 +2743,9 @@ Released 2018-09-13
[`identity_op`]: https://rust-lang.github.io/rust-clippy/master/index.html#identity_op
[`if_let_mutex`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_let_mutex
[`if_let_redundant_pattern_matching`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_let_redundant_pattern_matching
[`if_let_some_result`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_let_some_result
[`if_not_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_not_else
[`if_same_then_else`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_same_then_else
[`if_then_panic`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_then_panic
[`if_then_some_else_none`]: https://rust-lang.github.io/rust-clippy/master/index.html#if_then_some_else_none
[`ifs_same_cond`]: https://rust-lang.github.io/rust-clippy/master/index.html#ifs_same_cond
[`implicit_clone`]: https://rust-lang.github.io/rust-clippy/master/index.html#implicit_clone
Expand Down Expand Up @@ -2722,6 +2780,7 @@ Released 2018-09-13
[`iter_count`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_count
[`iter_next_loop`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_loop
[`iter_next_slice`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_next_slice
[`iter_not_returning_iterator`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_not_returning_iterator
[`iter_nth`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth
[`iter_nth_zero`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_nth_zero
[`iter_skip_next`]: https://rust-lang.github.io/rust-clippy/master/index.html#iter_skip_next
Expand Down Expand Up @@ -2773,6 +2832,7 @@ Released 2018-09-13
[`match_on_vec_items`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_on_vec_items
[`match_overlapping_arm`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_overlapping_arm
[`match_ref_pats`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_ref_pats
[`match_result_ok`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_result_ok
[`match_same_arms`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_same_arms
[`match_single_binding`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_single_binding
[`match_wild_err_arm`]: https://rust-lang.github.io/rust-clippy/master/index.html#match_wild_err_arm
Expand Down Expand Up @@ -2905,6 +2965,7 @@ Released 2018-09-13
[`reversed_empty_ranges`]: https://rust-lang.github.io/rust-clippy/master/index.html#reversed_empty_ranges
[`same_functions_in_if_condition`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_functions_in_if_condition
[`same_item_push`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_item_push
[`same_name_method`]: https://rust-lang.github.io/rust-clippy/master/index.html#same_name_method
[`search_is_some`]: https://rust-lang.github.io/rust-clippy/master/index.html#search_is_some
[`self_assignment`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_assignment
[`self_named_constructors`]: https://rust-lang.github.io/rust-clippy/master/index.html#self_named_constructors
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 @@ -8,7 +8,7 @@ license = "MIT OR Apache-2.0"
keywords = ["clippy", "lint", "plugin"]
categories = ["development-tools", "development-tools::cargo-plugins"]
build = "build.rs"
edition = "2018"
edition = "2021"
publish = false

[[bin]]
Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You can choose how much Clippy is supposed to ~~annoy~~ help you by changing the
| `clippy::style` | code that should be written in a more idiomatic way | **warn** |
| `clippy::complexity` | code that does something simple but in a complex way | **warn** |
| `clippy::perf` | code that can be written to run faster | **warn** |
| `clippy::pedantic` | lints which are rather strict or might have false positives | allow |
| `clippy::pedantic` | lints which are rather strict or have occasional false positives | allow |
| `clippy::nursery` | new lints that are still under development | allow |
| `clippy::cargo` | lints for the cargo manifest | allow |

Expand Down
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_dev/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "clippy_dev"
version = "0.0.1"
edition = "2018"
edition = "2021"

[dependencies]
bytecount = "0.6"
Expand Down
20 changes: 4 additions & 16 deletions src/tools/clippy/clippy_dev/src/bless.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
//! `bless` updates the reference files in the repo with changed output files
//! from the last test run.

use std::env;
use std::ffi::OsStr;
use std::fs;
use std::lazy::SyncLazy;
Expand All @@ -10,17 +9,9 @@ use walkdir::WalkDir;

use crate::clippy_project_root;

// NOTE: this is duplicated with tests/cargo/mod.rs What to do?
pub static CARGO_TARGET_DIR: SyncLazy<PathBuf> = SyncLazy::new(|| match env::var_os("CARGO_TARGET_DIR") {
Some(v) => v.into(),
None => env::current_dir().unwrap().join("target"),
});

static CLIPPY_BUILD_TIME: SyncLazy<Option<std::time::SystemTime>> = SyncLazy::new(|| {
let profile = env::var("PROFILE").unwrap_or_else(|_| "debug".to_string());
let mut path = PathBuf::from(&**CARGO_TARGET_DIR);
path.push(profile);
path.push("cargo-clippy");
let mut path = std::env::current_exe().unwrap();
path.set_file_name("cargo-clippy");
fs::metadata(path).ok()?.modified().ok()
});

Expand Down Expand Up @@ -94,10 +85,7 @@ fn updated_since_clippy_build(path: &Path) -> Option<bool> {
}

fn build_dir() -> PathBuf {
let profile = env::var("PROFILE").unwrap_or_else(|_| "debug".to_string());
let mut path = PathBuf::new();
path.push(CARGO_TARGET_DIR.clone());
path.push(profile);
path.push("test_build_base");
let mut path = std::env::current_exe().unwrap();
path.set_file_name("test");
path
}
2 changes: 1 addition & 1 deletion src/tools/clippy/clippy_lints/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ repository = "https://github.com/rust-lang/rust-clippy"
readme = "README.md"
license = "MIT OR Apache-2.0"
keywords = ["clippy", "lint", "plugin"]
edition = "2018"
edition = "2021"

[dependencies]
cargo_metadata = "0.12"
Expand Down
17 changes: 13 additions & 4 deletions src/tools/clippy/clippy_lints/src/derivable_impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@ use clippy_utils::diagnostics::span_lint_and_help;
use clippy_utils::{in_macro, is_automatically_derived, is_default_equivalent, remove_blocks};
use rustc_hir::{
def::{DefKind, Res},
Body, Expr, ExprKind, Impl, ImplItemKind, Item, ItemKind, Node, QPath,
Body, Expr, ExprKind, GenericArg, Impl, ImplItemKind, Item, ItemKind, Node, PathSegment, QPath, TyKind,
};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty::TypeFoldable;
use rustc_session::{declare_lint_pass, declare_tool_lint};
use rustc_span::sym;

Expand Down Expand Up @@ -68,6 +67,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
if let ItemKind::Impl(Impl {
of_trait: Some(ref trait_ref),
items: [child],
self_ty,
..
}) = item.kind;
if let attrs = cx.tcx.hir().attrs(item.hir_id());
Expand All @@ -80,9 +80,18 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
if let ImplItemKind::Fn(_, b) = &impl_item.kind;
if let Body { value: func_expr, .. } = cx.tcx.hir().body(*b);
if let Some(adt_def) = cx.tcx.type_of(item.def_id).ty_adt_def();
if !attrs.iter().any(|attr| attr.doc_str().is_some());
if let child_attrs = cx.tcx.hir().attrs(impl_item_hir);
if !child_attrs.iter().any(|attr| attr.doc_str().is_some());
then {
if cx.tcx.type_of(item.def_id).definitely_has_param_types_or_consts(cx.tcx) {
return;
if let TyKind::Path(QPath::Resolved(_, p)) = self_ty.kind {
if let Some(PathSegment { args: Some(a), .. }) = p.segments.last() {
for arg in a.args {
if !matches!(arg, GenericArg::Lifetime(_)) {
return;
}
}
}
}
let should_emit = match remove_blocks(func_expr).kind {
ExprKind::Tup(fields) => fields.iter().all(|e| is_default_equivalent(cx, e)),
Expand Down
Loading