Piti the little Light
8906040445
Improvements from PR feedback
2020-11-03 16:44:21 +01:00
Piti the little Light
a85670652a
Update: stderr message format
2020-11-03 16:42:30 +01:00
Piti the little Light
1b117f4629
Add tests for from_iter_instead_of_collect
2020-11-03 16:42:30 +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
Cameron Steffen
b2332a7357
Change lint to use const sym
2020-11-02 11:52:17 -06:00
ThibsG
ce98468158
Fix incorrect suggestion when from expansion in try_err
lint
2020-11-02 18:08:38 +01:00
ThibsG
343bdb3364
Give better suggestion by working on span on deref_addrof
lint
2020-11-02 18:08:38 +01:00
ThibsG
158bf9aa44
Fix incorrect suggestion for macro expansion in deref_addrof
lint
2020-11-02 18:08:38 +01:00
Henri Lunnikivi
7b203f3da6
Implement field_reassign_with_default
...
- Implement `field_reassign_with_default` as a `LateLintPass`
- Avoid triggering `default_trait_access` on a span already linted by
`field_reassigned_with_default`
- Merge `default_trait_access` and `field_reassign_with_default` into
`Default`
- Co-authored-by: Eduardo Broto <ebroto@tutanota.com>
- Fixes #568
2020-10-31 15:49:58 +02:00
Eduardo Broto
f8ac1f99ef
Address suggestions in PR review
2020-10-30 23:47:22 +01:00
Eduardo Broto
d958269fe5
Rename single_char_push_str to single_char_add_str
2020-10-30 23:29:44 +01:00
Matthias Krüger
c1eb8ceede
get_hint_if_single_char_arg: fix bug where multi-char letters are not detected properly
2020-10-30 23:29:44 +01:00
Matthias Krüger
c6412aeebc
handle macros returning Strings in single_char_push_str and single_char_insert_str
2020-10-30 23:29:38 +01: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
bors
084b203988
Auto merge of #6260 - matthiaskrgr:ices, r=ebroto
...
add a couple of ICE testcases
Fixes #6250
Fixes #6251
Fixes #6252
Fixes #6255
Fixes #6256
changelog: none
2020-10-30 22:19:11 +00:00
bors
7387b87bb9
Auto merge of #6197 - ThibsG:ImproveFilterNext, r=ebroto
...
Improve suggestions for several lints
This PR is a follow-up of this [Zulip discussion](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/filter_next.20lint ).
It unifies placeholders for `methods` module and improves several suggestions for `filter_next`, `filter_map_next` and `map_unwrap_or` lints.
changelog: none
2020-10-30 21:58:09 +00:00
Cameron Steffen
c0d1002d93
Fix unnecessary_lazy_eval suggestion applicability
...
Fixes #6240
2020-10-30 16:10:01 -05:00
Cameron Steffen
7c74d870b5
Fix vec_box scope error
...
Fixes #6236
2020-10-30 13:09:27 -05:00
bors
0be654482c
Auto merge of #6229 - henil:improve-integer-division-lint, r=phansch
...
Update the existing arithmetic lint
re: #6209
Updates the lint to not the error message if RHS of binary operation `/` of `%` is a literal/constant that is not `0` or `-1`, as suggested [here](https://github.com/rust-lang/rust-clippy/issues/6209#issuecomment-715624354 )
changelog: Expand [`integer_arithmetic`] to work with RHS literals and constants
2020-10-30 12:37:46 +00:00
henil
fa0a78b130
removed lint for division/modulo for literal 0
2020-10-30 17:31:10 +05:30
bors
74d8fbb7a4
Auto merge of #6200 - rail-rain:borrowed_box_invalid_sugg, r=phansch
...
fix the error-causing suggestion of 'borrowed_box'
Fixes #3128
Fix the suggestion of 'borrowed_box', which causes a syntax error because it misses necessary parentheses.
---
changelog: Fix the error-causing suggestion of 'borrowed_box'
2020-10-30 10:40:44 +00:00
dvermd
7b065dba84
clippy: update reference file to match suggested change
2020-10-29 17:38:46 +01:00
bors
c57d8ae515
Auto merge of #6227 - HMPerson1:collect_map, r=phansch
...
Add lint for replacing `.map().collect()` with `.try_for_each()`
Fixes #6208
changelog: Add `map_collect_result_unit`
2020-10-29 15:34:15 +00:00
bors
e1a2845558
Auto merge of #6226 - Urcra:master, r=flip1995
...
Add lint for comparing to empty slices instead of using .is_empty()
Hey first time making a clippy lint
I added the implementation of the lint the `len_zero` since it shared a lot of the code, I would otherwise have to rewrite. Just tell me if the lint should use it's own file instead
changelog: Add lint for comparing to empty slices
Fixes #6217
2020-10-29 15:12:24 +00:00
bors
ee9da9a194
Auto merge of #6176 - achris:issues/578, r=phansch
...
Lint items after statements in local macro expansions
The items_after_statements lint was skipping all expansions. Instead
we should still lint local macros.
Fixes #578
---
*Please keep the line below*
changelog: The items_after_statements now applies to local macro expansions
2020-10-29 14:51:41 +00:00
bors
e8de57c20d
Auto merge of #6212 - ThibsG:MacroTopLevelRefArg, r=flip1995
...
No lint in macro for `toplevel_ref_arg`
Do not lint when the span is from a macro.
Question: shouldn't we extend this for external macros also ?
Fixes : #5849
changelog: none
2020-10-29 14:29:30 +00:00
henil
e97602e482
Update existing arithmetic lint and add new tests related to it.
2020-10-29 19:08:52 +05:30
Eduardo Broto
50419118b4
Merge commit '645ef505da378b6f810b1567806d1bcc2856395f' into clippyup
2020-10-28 23:36:07 +01:00
Matthias Krüger
abd64d7c05
add a couple of ICE testcases
...
Fixes #6250
Fixes #6251
Fixes #6252
Fixes #6255
Fixes #6256
2020-10-28 23:35:11 +01:00
Eduardo Broto
a50d9e7af6
Deprecate temporary_cstr_as_ptr
2020-10-28 22:34:45 +01:00
Takayuki Nakata
8e988e1c66
Merge remote-tracking branch 'upstream/master' into sync-from-rust
2020-10-28 14:14:09 +09:00
Takayuki Nakata
4c58860cbf
Fix suggestion to add unneeded space in unused_unit
2020-10-28 12:40:47 +09:00
Aleksei Latyshev
2b7dd31368
improve MATCH_LIKE_MATCHES_MACRO lint
...
- add tests
- refactor match_same_arms lint
- prioritize match_expr_like_matches_macro over match_same_arms
2020-10-27 23:45:58 +03:00
Michael Wright
66d56fefc5
Add invalid_paths
internal lint
2020-10-27 07:42:13 +02:00
Tim Nielens
111b9023da
add manual_ok_or lint
2020-10-27 01:57:04 +01:00
rail
e568a328f9
fix the error-causing suggestion of 'borrowed_box'
...
fix the error-causing suggestion of 'borrowed_box',
which missed parentheses and was ambiguous.
2020-10-27 12:11:09 +13:00
Nathan Whitaker
a1bb10e9b8
Remove lint from clippy
2020-10-26 18:19:48 -04:00
dvermd
6212950ceb
Explain why 'run-rustfix' is not defined
2020-10-26 23:00:10 +01:00
dvermd
2270ff4d16
clippy_lint: Add test cases
2020-10-26 22:34:43 +01:00
dvermd
bdd76a9d1c
clippy_lint: Allow 'ref_option_ref' for 'option_if_let_else'
2020-10-26 22:34:42 +01:00
dvermd
469b2fc781
clippy_lint: Add 'ref_option_ref' move to check_ty and add type alias test
2020-10-26 22:34:42 +01:00
dvermd
213dbf7aac
clippy_lint: Add 'ref_option_ref'
2020-10-26 22:34:40 +01:00
ThibsG
c0dd1f9f76
Fix tests for map_unwrap_or*
2020-10-26 11:15:01 +01:00
ThibsG
e2d86b5b80
Move fixable filter_next
and filter_map_next
cases to rustfixed tests
2020-10-26 11:02:07 +01:00
ThibsG
2a3ae11485
Move fixable map_unwrap_or
cases to rustfixed test
2020-10-26 11:02:07 +01:00
ThibsG
3fec6f568d
Improve some suggestions for filter_map_next
, filter_next
and map_unwrap_or
lints
2020-10-26 11:02:07 +01:00
ThibsG
2911d9c7de
Use better placeholders for some methods lint messages
2020-10-26 11:02:07 +01:00
ThibsG
bab338685f
No lint in external macro for toplevel_ref_arg
2020-10-26 10:14:03 +01:00
HMPerson1
f0cf3bdca1
Add lint for replacing .map().collect()
with .try_for_each()
2020-10-25 21:20:57 -04:00
Urcra
de5a6d3420
Initial implementation of comparison_to_empty
2020-10-26 00:31:25 +01:00