bors
f897d27d8b
Auto merge of #6339 - CDirkx:redundant-pattern-match-poll, r=ebroto
...
Change `redundant_pattern_matching` to also lint `std::task::Poll`
`reduntant_pattern_matching` currently lints pattern matching on `Option` and `Result` where the `is_variant` utility methods could be used instead: `is_some`, `is_none`, `is_ok`, `is_err`. This PR extends this behaviour to `std::task::Poll`, suggesting the methods `is_pending` and `is_ready`.
Motivation: The current description of `redundant_pattern_matching` mentions
> It's more concise and clear to just use the proper utility function
which in my mind applies to `Poll` as well.
changelog: Enhance [`redundant_pattern_matching`] to also lint on `std::task::Poll`
2020-11-24 23:19:43 +00:00
bors
8325d48d2d
Auto merge of #6351 - flip1995:rustup, r=flip1995
...
Rustup
r? `@ghost`
changelog: none
2020-11-20 09:07:56 +00:00
Christiaan Dirkx
5a83968877
Change redundant_pattern_matching to also lint std::task::Poll
...
Suggest using utility methods `is_pending` and `is_ready`.
2020-11-17 23:40:31 +01:00
Camelid
4e4c4fb8aa
Fix handling of panic calls
...
This should make Clippy more resilient and will unblock #78343 .
This PR is made against rust-lang/rust to avoid the need for a subtree
sync at @flip1995's suggestion in rust-lang/rust-clippy#6310 .
2020-11-17 12:16:15 -08:00
bors
92ba07582e
Auto merge of #6134 - patrickelectric:as_utf8, r=llogiq
...
Check when `from_utf8` is called from sliced byte array from string
---
*Please keep the line below*
changelog: Fix #5487 : Add linter to check when `from_utf8` is called from sliced byte array from string.
2020-11-07 17:06:27 +00:00
flip1995
34244190d4
Merge commit ' b20d4c155d' into clippyup
2020-11-05 14:29:48 +01:00
Patrick José Pereira
bc27d1492d
Add string_from_utf8_as_bytes linter
...
Signed-off-by: Patrick José Pereira <patrickelectric@gmail.com>
2020-11-04 21:17:46 -03:00
bors
a2bf404d34
Auto merge of #6101 - pitiK3U:from_iter_instead_of_collect, r=flip1995
...
Add lint: from_iter_instead_of_collect
Fixes #5679
This implements lint for `::from_iter()` from #5679 not the general issue (`std::ops::Add::add`, etc.).
This lint checks if expression is function call with `from_iter` name and if it's implementation of the `std::iter::FromIterator` trait.
changelog: Introduce from_iter_instead_of_collect lint
2020-11-03 15:59:16 +00:00
Piti the little Light
e320dd3042
Improve: error message
2020-11-03 16:44:23 +01:00
Piti the little Light
8906040445
Improvements from PR feedback
2020-11-03 16:44:21 +01:00
Piti the little Light
315bab0ea1
Add from_iter_instead_of_collect lint implementation
2020-11-03 16:42:28 +01:00
bors
3ee9c2e1a0
Auto merge of #6037 - matthiaskrgr:single_char_insert, r=flip1995
...
single_char_insert_str: lint using insert_str() on single-char literals and suggest insert()
Fixes #6026
changelog: add single_char_insert_str lint which lints using string.insert_str() with single char literals and suggests string.insert() with a char
2020-11-03 15:36:33 +00:00
Aaron Hill
4bbc7712fc
Update Clippy path to Lint
2020-10-30 21:41:16 -04:00
Matthias Krüger
2350ee75b2
single_char_push_str lint using insert_str() on single-char literals and suggest insert()
...
changelog: single_char_push_str: lint using string.insert_str() with single char literals and suggests string.insert() with a char
Fixes #6026
2020-10-30 23:28:17 +01:00
Eduardo Broto
50419118b4
Merge commit ' 645ef505da' into clippyup
2020-10-28 23:36:07 +01:00
Takayuki Nakata
8e988e1c66
Merge remote-tracking branch 'upstream/master' into sync-from-rust
2020-10-28 14:14:09 +09:00
Michael Wright
f79c4afd3a
Fix invalid paths
2020-10-27 07:43:38 +02:00
Nathan Whitaker
a1bb10e9b8
Remove lint from clippy
2020-10-26 18:19:48 -04:00
Daniel Smith
57bf80f776
Add lint for holding RefCell Ref across an await
2020-10-21 11:04:26 -04:00
Jacob Hughes
29392a1728
Appease the almightly lord clippy, hallowed be thy name
2020-10-17 13:48:54 -04:00
flip1995
fbf2430f02
Merge commit ' 2f6439ae6a' into clippyup
2020-10-09 12:45:29 +02:00
Michael Howell
840f7daaad
Deprecate clippy lint
2020-10-02 11:34:14 -07:00
flip1995
d1f9cad102
Merge commit ' e636b88aa1' into clippyup
2020-09-24 14:49:22 +02:00
Lzu Tao
78f9ea5431
Fix clippy hard-code slice::Iter path
2020-09-15 10:21:40 +00:00
flip1995
a12828a80a
Merge commit ' 5034d47f72' into clippyup
2020-09-10 17:47:07 +02:00
flip1995
282c59820b
Merge commit ' 3d0b0e66af' into clippyup
2020-08-28 18:43:25 +02:00
David Wood
f13d2bfd9b
clippy: support QPath::LangItem
...
This commit updates clippy with the introduction of `QPath::LangItem` so
that it still compiles.
Signed-off-by: David Wood <david@davidtw.co>
2020-08-17 13:55:05 +01:00
flip1995
027780ca2c
Merge commit ' 09bd400243' into clippyup
2020-08-11 17:50:45 +02:00
flip1995
d164ab65f7
Merge commit ' da5a6fb1b6' into clippyup
2020-07-26 21:07:07 +02:00
flip1995
6f25adbd5a
Merge commit ' 2ca58e7dda' into clippyup
2020-07-14 14:59:59 +02:00
Lzu Tao
8db24840f7
Merge commit ' ff0993c5e9' into clippy
2020-06-09 14:36:01 +00:00
flip1995
a0e9f9bd0d
Merge commit ' 7ea7cd165a' into clippyup2
2020-05-28 15:45:24 +02:00
flip1995
d13d8987b0
Merge commit ' 43a1777b89' into clippyup
2020-05-11 20:23:47 +02:00
Philipp Hansch
0480ff861a
More diagnostic items
...
In particular for:
* `VecDeque`
* `String`
* `Mutex`
* `HashMap`
* `HashSet`
cc https://github.com/rust-lang/rust/pull/71414 https://github.com/rust-lang/rust-clippy/issues/5393
2020-04-26 13:44:08 +02:00
Andy Weiss
2dc8c083f5
Switch to matching against full paths instead of just the last element of the path
2020-04-21 21:07:43 -07:00
Eduardo Broto
00b4f2819f
Implement unsafe_derive_deserialize lint
2020-04-19 23:26:17 +02:00
Philipp Hansch
79982a2813
Make use of some existing diagnostic items
2020-04-12 13:58:04 +02:00
Philipp Hansch
1d1b6d886b
Say that diagnostic items are preferred over paths
2020-04-12 13:58:04 +02:00
Jacek Pospychala
f8e892db5e
useless Rc<Rc<T>>, Rc<Box<T>>, Rc<&T>, Box<&T>
2020-04-02 00:02:25 +02:00
flip1995
7d58ba20b4
Rustup to rust-lang/rust#70632
2020-04-01 20:14:05 +02:00
Tomasz Miąsko
b77b219280
Lint unnamed address comparisons
2020-03-30 21:42:16 +02:00
Jacob Meyers
0f7f30711e
add lint on File::read_to_string and File::read_to_end
2020-03-06 09:50:49 -05:00
flip1995
91042db2e8
Add path for display trait
2020-03-03 10:54:30 +01:00
flip1995
58cea334ec
Use lang items instead of get_trait_def_id where possible
2020-03-03 10:54:30 +01:00
daxpedda
0ee393cf01
Add tests and improve checks.
2020-02-17 14:43:38 +01:00
Areredify
63ab7a5e8c
lint all guard types, not just lock functions
2020-01-30 18:46:22 +03:00
Mikhail Babenko
d1f8621711
add lint
2020-01-30 16:48:56 +03:00
Areredify
796958c7e2
add option_as_ref_deref lint
2020-01-23 16:12:16 +03:00
xiongmao86
3c59eaf91c
Add lint logic.
2020-01-12 19:54:17 +08:00
Yuki Okushi
9086b17e14
Rustup to rust-lang/rust#67707
2019-12-31 09:17:56 +09:00