bors
0552852d9a
Auto merge of #7000 - Jarcho:clone_on_copy_fp, r=llogiq
...
Improve `clone_on_copy`
This also removes the `clone_on_copy_mut` test as the same thing is covered in the `clone_on_copy` test.
changelog: `copy_on_clone` lint on chained method calls taking self by value
changelog: `copy_on_clone` only lint when using the `Clone` trait
changelog: `copy_on_clone` correct suggestion when the cloned value is a macro call.
2021-03-30 05:25:28 +00:00
bors
1ddeaa6356
Auto merge of #6990 - Y-Nak:refactor-functions, r=giraffate
...
Organize functions into functions module
Ref: #6680
Rearrange lints in `functions`.
changelog: none
2021-03-30 03:59:45 +00:00
Yoshitomo Nakanishi
541c8b8f69
Improve documents in functions group
2021-03-30 11:45:54 +09:00
bors
a521445000
Auto merge of #7003 - giraffate:use_uppercase_for_msrv, r=camsteffen
...
Use uppercase for MSRV
A follow-up of <https://github.com/rust-lang/rust-clippy/pull/6977/files#diff-dac623e7b9c58138761aa527bf5f026bf113cda5b22eea61e655b44dd113389e >
changelog: none
2021-03-30 00:55:42 +00:00
Takayuki Nakata
23508a1ae2
Use uppercase for MSRV
2021-03-30 08:42:59 +09:00
Jason Newcomb
d2657769a2
Improve clone_on_copy
...
Lint on `_.clone().method()` when method takes self by value
Set applicability correctly
Correct suggestion when the cloned value is a macro call. e.g. `m!(x).clone()`
Don't lint when not using the `Clone` trait
2021-03-29 16:10:37 -04:00
bors
0e06b3c5f3
Auto merge of #6996 - Y-Nak:missing_panics_doc, r=Manishearth
...
Allow missing panics doc if the panics occur only when debug-assertions is specified
fixes #6970
changelog: `missing_panics_doc`: Allow missing panics doc if the panics occur only when `debug-assertions` is specified.
2021-03-29 15:04:27 +00:00
Yoshitomo Nakanishi
31afdfc12b
missing_panics_doc: Ignore usage of debug_assert family
2021-03-29 17:20:04 +09:00
Yoshitomo Nakanishi
1f95940c24
Fix inconsistent test name
2021-03-29 16:25:30 +09:00
bors
c07103b4a2
Auto merge of #6993 - Jarcho:expl_impl_clone, r=llogiq
...
Improve `expl_impl_clone_on_copy`
fixes : #1254
changelog: Check to see if the generic constraints are the same as if using derive for `expl_impl_clone_on_copy`
2021-03-28 23:30:56 +00:00
bors
4bcc552587
Auto merge of #6991 - matthiaskrgr:5396, r=giraffate
...
redundant_pattern_matching: look inside Refs
look inside refs and detect if let &None = ...
Fixes https://github.com/rust-lang/rust-clippy/issues/5396
changelog: redundant_pattern_matching: look inside Refs to fix FNs with "if let &None = .. "
2021-03-28 14:20:53 +00:00
Jason Newcomb
879fa5c972
Improve expl_impl_clone_on_copy
...
Check to see if the generic constraints are the same as if using derive
2021-03-28 07:54:00 -04:00
Matthias Krüger
e006c77d61
redundant_pattern_matching: look inside Refs
...
look inside refs and detect if let &None = ...
Fixes https://github.com/rust-lang/rust-clippy/issues/5396
changelog: redundant_pattern_matching: look inside Refs to fix FNs with "if let &None = .. "
2021-03-28 00:04:44 +01:00
Yoshitomo Nakanishi
add3e5094f
Move result_unit_err to its own module
2021-03-27 22:49:55 +09:00
Yoshitomo Nakanishi
c37916501d
Move lints related to must_use to their own module
2021-03-27 22:49:55 +09:00
Yoshitomo Nakanishi
9782fc4285
move not_unsafe_ptr_arg_deref to its own module
2021-03-27 22:49:55 +09:00
Yoshitomo Nakanishi
7c028de05f
Move too_many_lines to its own module
2021-03-27 22:49:55 +09:00
Yoshitomo Nakanishi
febf34e2b4
Move too_many_arguments to its own module
2021-03-27 22:49:55 +09:00
bors
8e56a2b27f
Auto merge of #6979 - flip1995:msrv_doc_fix, r=giraffate
...
Add missing lints to MSRV config doc
r? `@giraffate`
changelog: Add missing lints to MSRV config doc
2021-03-27 13:27:51 +00:00
bors
dcee00d64b
Auto merge of #6980 - Jarcho:len_without_is_empty_sig, r=llogiq
...
`len_without_is_empty` improvements
fixes : #6958
fixes : #6972
changelog: Check the return type of `len`. Only integral types, or an `Option` or `Result` wrapping one.
changelog: Ensure the return type of `is_empty` matches. e.g. `Option<usize>` -> `Option<bool>`
2021-03-27 13:10:43 +00:00
Jason Newcomb
12985afbca
len_without_is_empty
improvements
...
Check the return type of `len`. Only integral types, or an `Option` or `Result` wrapping one.
Ensure the return type of `is_empty` matches. e.g. `Option<usize>` -> `Option<bool>`
2021-03-27 09:04:44 -04:00
Matthias Krüger
ca7e95501c
upper_case_acronyms: add ui and ui-toml tests for private/public enums
2021-03-27 01:08:14 +01:00
Matthias Krüger
4e19d406a9
upper_case_acronyms: only lint enum variants if the enum is not public
2021-03-27 00:44:30 +01:00
flip1995
5351bbfbf5
Add missing lints to MSRV config doc
2021-03-26 16:58:06 +01:00
bors
6f2a6fe84f
Auto merge of #6977 - flip1995:or_patterns_msrv, r=llogiq
...
Add MSRV options to `unnested_or_patterns`
changelog: [`unnested_or_patterns`] can now be configured with the `msrv` config/attribute.
Fixes #6953
2021-03-26 15:12:50 +00:00
flip1995
5279b5948c
Fix trailing whitespaces in doc/adding_lints.md
2021-03-26 14:36:09 +01:00
flip1995
9ce9989f59
Improve doc on how to add MSRV to a lint
2021-03-26 14:36:09 +01:00
flip1995
1a1adad81d
Add MSRV option to unnested_or_patterns lint
2021-03-26 14:36:09 +01:00
Yoshitomo Nakanishi
818f8320a3
Merge type_complexity pass into types pass
2021-03-26 20:22:07 +09:00
Yoshitomo Nakanishi
bd1201a263
Fix inconsistent test names
2021-03-26 20:19:34 +09:00
Yoshitomo Nakanishi
494bc8a30c
Fix FN that types lints don't work with const or static
2021-03-26 20:19:34 +09:00
Yoshitomo Nakanishi
dad39b6613
Move implicit_hasher to its own module
2021-03-26 20:18:37 +09:00
Yoshitomo Nakanishi
f231b59b9e
Move invalid_upcast_comparisons to its own module
2021-03-26 20:18:37 +09:00
Yoshitomo Nakanishi
caa49c85d6
Move absurd_extreme_comparisons to its own module
2021-03-26 20:18:37 +09:00
bors
63aca96e91
Auto merge of #6975 - Jarcho:redundant_slicing_fp, r=llogiq
...
Improve `redundant_slicing`
fixes : #6968
changelog: Fix `redundant_slicing` suggestion when a reborrow might be required or when the value is from a macro call
2021-03-26 10:01:26 +00:00
Jason Newcomb
0ff68bb151
Improve redundant_slicing
...
Fix bad suggestion when a reborrow might be required
Fix bad suggestion when the value being sliced is a macro call
Don't lint inside of a macro due to the previous context sensitive changes
2021-03-25 22:30:14 -04:00
bors
f41d68faa6
Auto merge of #6961 - xFrednet:changelog-1-52, r=flip1995
...
Update changelog for 1.52
I've underestimated the work that goes into this a bit, but it just shows that a lot has happened again in Clippy in 1.52 🙃 .
[Rendered](https://github.com/xFrednet/rust-clippy/blob/changelog-1-52/CHANGELOG.md )
---
changelog: none
2021-03-25 18:39:19 +00:00
xFrednet
3a4c0a7fd8
Updated changelog for 1.52
...
Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
2021-03-25 19:37:31 +01:00
bors
0e87918536
Auto merge of #6971 - flip1995:rustup, r=flip1995
...
Rustup
r? `@ghost`
changelog: none
2021-03-25 17:49:06 +00:00
flip1995
40e68e5956
Bump Clippy Version -> 0.1.53
2021-03-25 18:48:48 +01:00
flip1995
06940fdda8
Bump nightly version -> 2021-03-25
2021-03-25 18:38:52 +01:00
flip1995
1f5f184105
Merge remote-tracking branch 'upstream/master' into rustup
2021-03-25 18:38:13 +01:00
bors
981ffa7c14
Auto merge of #6959 - ebobrow:iss-6927-fix, r=camsteffen
...
Check for `.to_string().into_bytes()` in string_lit_to_bytes
fixes #6927
changelog: Add a check for `into_bytes()` to string_lit_to_bytes lint
2021-03-25 03:01:35 +00:00
Elliot Bobrow
e9ebc27525
check for .to_string().into_bytes()
in string_lit_to_bytes
...
apply changes from review
2021-03-24 17:31:20 -07:00
bors
4a1825a609
Auto merge of #6952 - Jarcho:new_ret_no_self_fp, r=Manishearth
...
Fix `new_ret_no_self` false positive
fixes : #1724
changelog: Fix false positive with `new_ret_no_self` when returning `Self` with different generic arguments
2021-03-24 21:09:01 +00:00
Jason Newcomb
6e88900f9e
Rename contains_adt
to contains_adt_constructor
2021-03-24 16:23:02 -04:00
Jason Newcomb
99b8a67198
Fix false positive with new_ret_no_self
when returning Self
with different generic arguments
2021-03-24 16:22:28 -04:00
bors
917b538c68
Auto merge of #6962 - TaKO8Ki:fix-false-positive-in-manual-flatten, r=llogiq
...
Fix false positive in `manual_flatten`
This pull request fixes false positive in `manual_flatten` in case using a slice of references .
closes : #6893
changelog: fix false positive in `manual_flatten`
2021-03-24 18:42:20 +00:00
Takayuki Maeda
2f8d71b9dc
merge imports
2021-03-25 00:17:43 +09:00
Takayuki Maeda
3b8e85a5dc
fix false positive in manual_flatten
2021-03-25 00:15:21 +09:00