Commit graph

3196 commits

Author SHA1 Message Date
JarredAllen 8590ab4d46 More progress towards sort_by_key_reverse lint 2020-05-31 11:55:45 -07:00
JarredAllen 24847ea53e Attempted start at sort_by_key_reverse lint 2020-05-31 11:55:45 -07:00
JarredAllen 7e843515d9 Created lint 2020-05-31 11:55:45 -07:00
flip1995 77dd0ea62a
Add tests for empty blocks 2020-05-31 19:29:36 +02:00
flip1995 6d15a14964
Update test files 2020-05-31 18:50:33 +02:00
flip1995 380d941a04
Adapt stderr and fixed files 2020-05-31 18:48:28 +02:00
Philipp Krones 00c656d8ee
Rollup merge of #5663 - matthiaskrgr:crash_test_3969, r=Manishearth
add testcase that no longer ICEs

Fixes #3969

changelog: none
2020-05-31 14:57:34 +02:00
Philipp Krones 873c9fc8f2
Rollup merge of #5656 - ebroto:len_zero_ranges, r=matthiaskrgr
len_zero: skip ranges if feature `range_is_empty` is not enabled

If the feature is not enabled, calling `is_empty()` on a range is ambiguous. Moreover, the two possible resolutions are unstable methods, one inherent to the range and the other being part of the `ExactSizeIterator` trait.

Since `len_zero` only checks for existing `is_empty()` inherent methods, we only take into account the `range_is_empty` feature.

Related: https://github.com/rust-lang/rust/issues/48111#issuecomment-445132965

changelog: len_zero: avoid linting ranges without #![feature(range_is_empty)]

Fixes: #3807
2020-05-31 14:57:33 +02:00
Philipp Krones 0fff522071
Rollup merge of #5637 - montrivo:feature/vec_resize_to_zero, r=yaahc,flip1995
new lint: vec_resize_to_zero

implements #5444

changelog: new lint vec_resize_to_zero
2020-05-31 14:57:32 +02:00
flip1995 37381d33a4
Fix sync fallout 2020-05-31 14:05:57 +02:00
Tim Nielens 5faab874f9 new lint: vec_resize_to_zero 2020-05-30 17:52:10 +02:00
Matthias Krüger b92cc8a08d add testcase that no longer ICEs
Fixes #3969
2020-05-29 22:52:24 +02:00
flip1995 b6c58f0d72 Temp fix: don't run cargo lint tests in rustc test suite 2020-05-28 17:19:30 +02:00
flip1995 a0e9f9bd0d Merge commit '7ea7cd165ad6705603852771bf82cc2fd6560db5' into clippyup2 2020-05-28 15:45:24 +02:00
Eduardo Broto 64a05f56c3 len_zero: skip ranges if feature range_is_empty is not enabled 2020-05-28 00:58:48 +02:00
bors ee3088f27b Auto merge of #5631 - ThibsG:ExtendUselessConversion, r=matthiaskrgr
Extend useless conversion

This PR extends `useless_conversion` lint with `TryFrom` and `TryInto`

fixes: #5344

changelog: Extend `useless_conversion` with `TryFrom` and `TryInto`
2020-05-27 13:06:59 +00:00
Matthias Krüger 3089c3b307 rustup https://github.com/rust-lang/rust/pull/72342, allow unused_crate_dependencies 2020-05-27 13:57:48 +02:00
ThibsG 1801841ae5 Add test cases for broader coverage 2020-05-26 18:43:12 +02:00
bors 291385b3e0 Auto merge of #5609 - phansch:empty-line-after-outer-attr-fix, r=flip1995
Make empty_line_after_outer_attr an early lint

Fixes #5567

Unfortunately I couldn't find a way to reproduce the issue without syn/quote. Considering that most real-world macros use syn and/or quote, I think it's okay to pull them in anyway.

changelog: Fix false positive in [`empty_line_after_outer_attr`]
2020-05-26 15:10:35 +00:00
Philipp Hansch 67167be167
Make empty_line_after_outer_attr an early lint 2020-05-26 16:52:02 +02:00
bors a00025ab21 Auto merge of #5638 - ebroto:issue_5628_add_suggestion_for_reversed_empty_ranges, r=phansch
reversed_empty_ranges: add suggestion for &slice[N..N]

As discussed in the issue thread, the user accepted this solution. Let me know if this is what we want, or if changing the way we lint the N..N case is prefered.

changelog: reversed_empty_ranges: add suggestion for &slice[N..N]

Closes #5628
2020-05-26 11:56:16 +00:00
bors 182ac89f16 Auto merge of #5636 - ebroto:issue_5041, r=phansch
multiple_crate_versions: skip dev and build deps

changelog: multiple_crate_versions: skip dev and build deps

Closes #5041
2020-05-26 06:23:58 +00:00
bors 2a6cfa7f05 Auto merge of #5647 - ebroto:5644_allow_ptr_arg_in_arg_position, r=flip1995
ptr_arg: honor `allow` attribute on arguments

The `intravisit::Visitor` impl for `LateContextAndPass` only takes into account the attributes of a function parameter inside the `check_param` method. `ptr_arg` starts its heuristics at `check_item` / `check_impl_item` / `check_trait_item`, so the `allow` is not taken into account automatically.

changelog: ptr_arg: honor `allow` attribute on arguments

Fixes #5644
2020-05-25 21:47:07 +00:00
Eduardo Broto a1824e187c ptr_arg: honor allow attr on arguments 2020-05-25 23:09:06 +02:00
Jeremy Stucki d9f55322cc
Update ui test 2020-05-25 21:41:28 +02:00
Jeremy Stucki 6bd9cd99a3
Add tests 2020-05-25 21:41:19 +02:00
bors 6de17b043d Auto merge of #5635 - montrivo:bugfix/option_option_test_case, r=flip1995
option_option test case #4298

Adds regression test case for #4298.

The bug seems still present although rust Playground said otherwise.

changelog: none
2020-05-25 19:22:08 +00:00
Eduardo Broto 60d38ee1dd reversed_empty_ranges: add suggestion for &slice[N..N] 2020-05-25 20:06:15 +02:00
ThibsG 705bfdcc46 Extend useless_conversion lint with TryInto 2020-05-25 20:00:39 +02:00
ThibsG 4f8909fad9 Extend useless_conversion lint with TryFrom 2020-05-25 20:00:39 +02:00
Eduardo Broto 8642fc97dd multiple_crate_versions: skip dev and build deps 2020-05-25 20:00:08 +02:00
Eduardo Broto cff5cff2f3 Make the name of the crate available in cargo UI tests 2020-05-25 20:00:08 +02:00
bors c41916d9bd Auto merge of #5616 - euclio:no-derive-suggestion, r=phansch,flip1995
new_without_default: do not suggest deriving

---

changelog: do not suggest deriving `Default` in `new_without_default`

This commit changes the behavior of the `new_without_default` lint to not suggest deriving `Default`. This suggestion is misleading if the `new` implementation does something different than what a derived `Default` implementation would do, because then the two methods would not be equivalent.

Instead, the `can_derive_default` check is removed, and we always suggest implementing `Default` in terms of `new()`.
2020-05-25 17:19:00 +00:00
Tim Nielens 29d043683e option_option test case #4298 2020-05-22 19:21:30 +02:00
Andy Russell a578bed69a
new_without_default: do not suggest deriving 2020-05-22 11:49:51 -04:00
Eduardo Broto f9013ff197 Relax fs layout so that multiple pass/fail manifests are possible 2020-05-21 15:34:48 +02:00
Eduardo Broto 7ff71199df Address comments from PR review 2020-05-21 14:46:04 +02:00
Eduardo Broto 7a0eccbd8a Add test for multiple_crate_versions
Make the output of the lint deterministic by sorting the versions
2020-05-21 14:11:11 +02:00
Eduardo Broto bc93f7052e Add test for cargo_common_metadata
Fix missing `authors` entry in the provided example
2020-05-21 14:11:11 +02:00
Eduardo Broto 96af3e8360 Add test for wildcard_dependencies 2020-05-21 14:11:11 +02:00
Eduardo Broto bd9b09e293 Adapt compile-test to run tests for cargo lints 2020-05-21 14:11:11 +02:00
Elichai Turkel 2db7f1abf8
Update future-not-send stderr output 2020-05-20 16:46:30 +03:00
Elichai Turkel ecd0a67b01
Make match_wild_err_arm pedantic, and update help messages 2020-05-20 16:39:03 +03:00
bors cafa94662c Auto merge of #5582 - vtmargaryan:match_wildcard_for_single_variants, r=flip1995
New lint: `match_wildcard_for_single_variants`

changelog: Added a new lint match_wildcard_for_single_variants to warn on enum matches where a wildcard is used to match a single variant

Closes #5556
2020-05-20 12:51:28 +00:00
flip1995 da9b138ec7
Update test after const_ptr functions are must_use now 2020-05-20 13:25:20 +02:00
bors 8164832c4b Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
Stabilize fn-like proc macros in expression, pattern and statement positions

I.e. all the positions in which stable `macro_rules` macros are supported.

Depends on https://github.com/rust-lang/rust/pull/68716 ("Stabilize `Span::mixed_site`").

cc https://github.com/rust-lang/rust/issues/54727
cc https://github.com/rust-lang/rust/issues/54727#issuecomment-580647446

Stabilization report: https://github.com/rust-lang/rust/pull/68717#issuecomment-623197503.
2020-05-19 03:11:32 +00:00
flip1995 f1d3086492 Merge commit 'e214ea82ad0a751563acf67e1cd9279cf302db3a' into clippyup 2020-05-17 17:36:26 +02:00
bors e214ea82ad Auto merge of #5568 - ThibsG:RenameIdentityConversionLint, r=flip1995
Rename lint `identity_conversion` to `useless_conversion`

Lint name `identity_conversion` was misleading, so this PR renames it to `useless_conversion`.

As decision has not really came up in the issue comments, this PR will probably need discussion.

fixes #3106

changelog: Rename lint `identity_conversion` to `useless_conversion`
2020-05-17 11:29:04 +00:00
Aleksei Latyshev 07f1edf2d4
improve and generalize option_and_then_some lint
- rename it to bind_instead_of_map
2020-05-17 12:17:03 +03:00
ThibsG e55b920970 Rename lint identity_conversion to useless_conversion 2020-05-16 22:50:20 +02:00