Commit Graph

5523 Commits

Author SHA1 Message Date
Yoshitomo Nakanishi
f098007caa Separate lints of casts group from types group 2021-03-09 10:57:32 +09:00
bors
2cb5bbf80c Auto merge of #6871 - camsteffen:redundant-closure-macro, r=Manishearth
Fix redundant closure with macros

changelog: Fix redundant_closure FPs with macros

Fixes #6732
Fixes #6850
Fixes #4354 (addresses the error message confusion)
2021-03-08 21:32:21 +00:00
Cameron Steffen
8c540dcd2d Improve the redundant_closure message 2021-03-08 13:16:53 -06:00
Cameron Steffen
bf98aa6fb8 Fix redundant closure with macros 2021-03-08 13:15:13 -06:00
Yoshitomo Nakanishi
db59c35b7e Fix some lints in types that fail dogfood 2021-03-09 00:52:25 +09:00
Yoshitomo Nakanishi
bb8208da2b Import declared lints at the top of the file 2021-03-09 00:51:06 +09:00
Yoshitomo Nakanishi
2afa7df564 Remove unused is_local from borrowed_box 2021-03-09 00:50:22 +09:00
Yoshitomo Nakanishi
53d3ffe539 Move borrowed_box to its own module 2021-03-09 00:50:22 +09:00
Yoshitomo Nakanishi
cc3ab1c0ec Move linked_list to its own module 2021-03-09 00:50:22 +09:00
Yoshitomo Nakanishi
b59c879fc9 Move option_option to its own module 2021-03-09 00:49:04 +09:00
Yoshitomo Nakanishi
fbd25e93a4 Add flags to detect lints are triggered 2021-03-09 00:49:04 +09:00
Yoshitomo Nakanishi
2c2fb3996f Move vec_box to its own module 2021-03-09 00:47:30 +09:00
Yoshitomo Nakanishi
f110c5e6f5 Move rc_buffer to its own module 2021-03-09 00:46:28 +09:00
Yoshitomo Nakanishi
128f1f5e2e Move redundant_allocation to its own module 2021-03-09 00:40:47 +09:00
Yoshitomo Nakanishi
df307c0ce7 Move box_vec to its own module 2021-03-09 00:36:46 +09:00
Yoshitomo Nakanishi
714a826439 Create types dir and move old module under it 2021-03-09 00:33:22 +09:00
Andrea Nall
9bdc273f03 relocate functions from clippy_lints::types
relocate `is_ty_param_lang_item` and `is_ty_param_diagnostic_item` to `clippy_utils`
2021-03-07 17:58:39 -06:00
Andrea Nall
3877a410be migrate paths to newly-added diagnostic items
This gets rid of the following paths:
  * OS_STRING
  * TO_OWNED
  * TO_STRING

Also removes some usages of:
  * PATH_BUF

And the now completely unused `clippy_lints::types::is_ty_param_path`
2021-03-07 17:53:12 -06:00
Jason Newcomb
47145dec36
len_without_is_empty will now consider multiple impl blocks
`len_without_is_empty` will now consider `#[allow]` on both the `len` method, and the type definition
2021-03-07 09:40:18 -05:00
bors
5945e85f34 Auto merge of #6823 - Jarcho:diagnostic_items, r=phansch
Use diagnostic or language items instead of paths

I think that gets everything except ones used in a list of paths to check.

changelog: none
2021-03-07 12:04:42 +00:00
Jason Newcomb
e4ffff9e72
Use LanguageItems::require 2021-03-06 13:03:13 -05:00
Mateusz Gacek
a0b7f9b3a0 useless_format: fix examples in the description
"Good" example was something not acceptable by the useless_format lint.
2021-03-05 12:11:31 -08:00
Cameron Steffen
5abd8c5995 Use typeck_body 2021-03-05 10:36:20 -06:00
Cameron Steffen
ae8ec07d2e Avoid mir in missing_errors_doc 2021-03-05 10:36:20 -06:00
Cameron Steffen
45454f0738 Avoid mir in implicit_return 2021-03-05 10:36:16 -06:00
flip1995
1d71d9a106
Fix dogfood errors in clippy_lints 2021-03-05 11:10:29 +01:00
bors
6680710961 Auto merge of #6833 - daxpedda:use-self, r=Manishearth
Fix false-positive in `use_self`

Fixes  #6818.

changelog: Fix false positives for use_self in macros.
2021-03-04 17:35:06 +00:00
bors
ff51964102 Auto merge of #6825 - djc:naive-bytecount-pedantic, r=Manishearth
Move naive_bytecount to pedantic

As discussed on Zulip, current best practice is to avoid recommending
external crates. This lint is from before that was enforced. Move it
to the pedantic group to avoid enabling it by default.

https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/naive_bytecount.20suggesting.20extra.20dependency

changelog: move [`naive_bytecount`] to pedantic
2021-03-03 21:26:24 +00:00
daxpedda
5656510eed
Fix false-positive in use_self 2021-03-03 17:32:49 +01:00
bors
43d19f63f7 Auto merge of #6824 - Y-Nak:refactor_loops_module, r=flip1995
Refactor: organize loops file into loops module (Delegated)

`@flip1995` `@nahuakang`

closes #6693
r? `@flip1995`

 As we talked about in the PM of Zulip,  this PR is a delegated PR from `@nahuakang.`

Changes from the last commit of #6693:
1. Unify the name of the main entries of all modules to check, that was pointed out [here](https://github.com/rust-lang/rust-clippy/pull/6693#discussion_r582897713)
2. Simplify ` check_for_loop_arg`, that was pointed out [here](https://github.com/rust-lang/rust-clippy/pull/6693#discussion_r582914044) and [here](https://github.com/rust-lang/rust-clippy/pull/6693#discussion_r582929910)
3. Resolve conflicts

changelog: Refactor `loops.rs` file into `loops` module.
2021-03-03 10:34:22 +00:00
bors
ece3543c9f Auto merge of #6801 - Jarcho:manual_match_fix, r=phansch
Fix `manual_map` false positives

fixes: #6795
fixes: #6797
fixes: #6811
fixes: #6819

changelog: Fix false positives for `manual_map` when `return`, `break`, `continue`, `yield`, `await`, and partially moved values are used.
changelog: Don't expand macros in suggestions  for `manual_map`
2021-03-02 15:36:00 +00:00
Dirkjan Ochtman
9e4a064f08 Move naive_bytecount to pedantic
As discussed on Zulip, current best practice is to avoid recommending
external crates. This lint is from before that was enforced. Move it
to the pedantic group to avoid enabling it by default.

https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/naive_bytecount.20suggesting.20extra.20dependency
2021-03-02 14:34:47 +01:00
Yoshitomo Nakanishi
19c886b407 Remove "for_loop_arg.rs" 2021-03-02 21:09:10 +09:00
bors
eb04beb005 Auto merge of #6791 - TaKO8Ki:iter-count, r=matthiaskrgr
New lint: `iter_count`

This pull request adds a new lint named `iter_count`.

---

closes https://github.com/rust-lang/rust-clippy/issues/6262

changelog: new lint `iter_count`
2021-03-02 11:31:43 +00:00
Yusuke Tanaka
bf000985f5
Make check_cast private 2021-03-02 10:40:25 +01:00
Yusuke Tanaka
8a8f7b4cf5
Refactor calls to lint check functions 2021-03-02 10:40:25 +01:00
Yusuke Tanaka
89ef26a681
Cleanup imports 2021-03-02 10:40:25 +01:00
Yusuke Tanaka
25c221ec92
Move transmutes_expressible_as_ptr_casts to its own module 2021-03-02 10:40:24 +01:00
Yusuke Tanaka
c57a8260f2
Move unsound_collection_transmute to its own module 2021-03-02 10:40:24 +01:00
Yusuke Tanaka
e7d2393d01
Move transmute_float_to_int to its own module 2021-03-02 10:40:24 +01:00
Yusuke Tanaka
acedc7b8f2
Move transmute_int_to_float to its own module 2021-03-02 10:40:24 +01:00
Yusuke Tanaka
d04ea41d1f
Move transmute_int_to_bool to its own module 2021-03-02 10:40:24 +01:00
Yusuke Tanaka
f8bc0e249c
Move transmute_ptr_to_ptr to its own module 2021-03-02 10:40:23 +01:00
Yusuke Tanaka
7af3458b54
Move transmute_bytes_to_str and transmute_ptr_to_ptr to transmute_ref_to_ref module 2021-03-02 10:40:23 +01:00
Yusuke Tanaka
4c65221188
Move transmute_int_to_char to its own module 2021-03-02 10:40:23 +01:00
Yusuke Tanaka
6442d45d3a
Move transmute_ptr_to_ref to its own module 2021-03-02 10:40:23 +01:00
Yusuke Tanaka
afc9275928
Move crosspointer_transmute to its own module 2021-03-02 10:37:30 +01:00
Yusuke Tanaka
ef97764dcc
Move wrong_transmute to its own module 2021-03-02 10:37:30 +01:00
Yusuke Tanaka
0d7dd00860
Move useless_transmute to its own module 2021-03-02 10:37:30 +01:00
Yusuke Tanaka
4ac438bfed
Add transmute/utils.rs 2021-03-02 10:37:30 +01:00