Commit graph

4710 commits

Author SHA1 Message Date
Philipp Krones
5dbca1f6b1
Add Applicability 2018-10-24 23:39:54 -04:00
HMPerson1
aabf8083bd
Add lint for calling mem::discriminant on a non-enum type 2018-10-24 23:39:54 -04:00
bors[bot]
4c6201dceb Merge #3312
3312: OUT_OF_BOUNDS_INDEXING false negative r=phansch a=JoshMcguigan

fixes #3102

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
2018-10-24 21:17:43 +00:00
bors[bot]
44fb29a356 Merge #3356
3356: Fix warnings introduced by #3349 r=flip1995 a=flip1995

I missed these warnings during review, should have checked the Travis log first.

Co-authored-by: flip1995 <hello@philkrones.com>
2018-10-24 15:25:12 +00:00
bors[bot]
bce190558f Merge #3338
3338: new_ret_no_self false positives r=flip1995 a=JoshMcguigan

~~WORK IN PROGRESS~~

I plan to fix all of the false positives in #3313 in this PR, but I wanted to open it now to start gathering feedback.

In this first commit, I've updated the lint to allow tuple return types as long as `Self` shows up at least once, in any position of the tuple. I believe this is the broadest possible interpretation of what should be allowed for tuple return types, but I would certainly be okay making the lint more strict. 

fixes #3313 

Co-authored-by: Josh Mcguigan <joshmcg88@gmail.com>
2018-10-24 14:42:40 +00:00
flip1995
57a18b6520
Fix warnings introduced by #3349 2018-10-24 16:18:01 +02:00
Josh Mcguigan
30ffc17ef7 new_ret_no_self added test cases 2018-10-24 06:43:21 -07:00
bors[bot]
319b75c75b Merge #3349
3349: Fixes #3347: Lint for wildcard dependencies in Cargo.toml r=ordovicia a=ordovicia

Add a lint for wildcard dependencies in Cargo.toml.
How should I write a test for this lint?

Fixes #3347

Co-authored-by: Hidehito Yabuuchi <hdht.ybuc@gmail.com>
2018-10-24 12:21:19 +00:00
Hidehito Yabuuchi
99b78f0650 Replace remaining krate.span with DUMMY_SP 2018-10-24 21:15:27 +09:00
Hidehito Yabuuchi
0d577c36a9 Use DUMMY_SP in multiple_crate_versions 2018-10-24 20:22:38 +09:00
Hidehito Yabuuchi
663f2cff7e Some fixes for wildcard_dependencies 2018-10-24 20:19:13 +09:00
bors[bot]
03f8899fa5 Merge #3350
3350: Don't emit `new_without_default_derive` if an impl of Default exists regardless of generics r=oli-obk a=pengowen123

Fixes #2226

Co-authored-by: Owen Sanchez <pengowen816@gmail.com>
2018-10-24 07:59:06 +00:00
Hidehito Yabuuchi
d334fab4d0 Run util/update_lints.py 2018-10-24 15:00:28 +09:00
Hidehito Yabuuchi
fa6c9f838c Minor changes on clippy_lints/src/wildcard_dependencies.rs 2018-10-24 15:00:28 +09:00
Hidehito Yabuuchi
0263ddde92 Lint for wildcard dependencies in Cargo.toml 2018-10-24 15:00:28 +09:00
bors[bot]
122da1de3b Merge #3339
3339: Check for known array length in `needless_range_loop` r=phansch a=HMPerson1

In `VarVisitor`, we now keep track of the type of the thing that was directly indexed and, if it's an array, check if the range's end is (or is past) the array's length.

Fixes  #3033

Co-authored-by: HMPerson1 <hmperson1@gmail.com>
2018-10-24 05:45:02 +00:00
bors[bot]
3ff2c1f053 Merge #3348
3348: Setup bors for Clippy r=phansch a=flip1995

Since [bors-ng](https://app.bors.tech/repositories/3993) is already installed for this repo for a while (https://github.com/rust-lang-nursery/rust-clippy/pull/3279#issuecomment-427645938), the only thing missing, before we can use it, is the `bors.toml`. (bors-ng [docs](https://bors.tech/documentation/getting-started/))

If we want to move forward with this and this gets merged, the only thing left to do is to create the branches `staging` and `trying`.

@phansch @oli-obk 

Co-authored-by: flip1995 <hello@philkrones.com>
Co-authored-by: Philipp Krones <hello@philkrones.com>
2018-10-24 05:16:43 +00:00
Philipp Hansch
304b5f1e45
Merge pull request #3352 from gnieto/fix/doc-inspector
Fix inspector pass documentation
2018-10-24 07:02:20 +02:00
Owen Sanchez
50b9e7aebc Don't emit new_without_default_derive if an impl of Default exists 2018-10-23 20:44:31 -07:00
Guillem Nieto
fd3651a551 Fix inspector pass documentation
When using `#[clippy_dump]`, the compiler complains about an unknown
attribute. The correct one seems to be `#[clippy::dump]`.
2018-10-23 23:03:23 +02:00
Philipp Krones
9086730dc4
Add branch configuration to appveyor.yml 2018-10-22 17:30:01 +02:00
flip1995
8fc84b1f55
Setup bors 2018-10-22 13:09:48 +02:00
Josh Mcguigan
a624583557 new_ret_no_self added test cases 2018-10-20 06:29:17 -07:00
Josh Mcguigan
079f9f45b5 new_ret_no_self walk return type to check for self 2018-10-19 17:54:25 -07:00
HMPerson1
553d01d9c7
Update ui/for_loop test output 2018-10-19 17:17:13 -04:00
HMPerson1
2e9172aea2
Check for known array length in needless_range_loop 2018-10-19 16:34:16 -04:00
Josh Mcguigan
097df8f223 new_ret_no_self correct false positive on raw pointer return types 2018-10-19 05:20:33 -07:00
Josh Mcguigan
6e75050be0 new_ret_no_self correct linting of tuple return types 2018-10-19 04:55:06 -07:00
Philipp Krones
b1d0343749
Merge pull request #3334 from matthiaskrgr/new-ret-no-self__doc
new_ret_no_self: add sample from #3313 to Known Problems section.
2018-10-19 01:32:57 +02:00
Matthias Krüger
fd2f6dd382 new_ret_no_self: add sample from #3313 to Known Problems section.
fix trivial typo on the way
2018-10-18 23:37:43 +02:00
Philipp Hansch
8f5a2484a0
Merge pull request #3303 from shssoichiro/3069-unnecessary-fold-pattern-guard
Note known false positives in unnecessary_fold lint
2018-10-18 22:26:33 +02:00
Philipp Krones
4dc6b367d3
Merge pull request #3332 from lukasstevens/fix798
Check for comments in collapsible ifs
2018-10-18 20:12:28 +02:00
Lukas Stevens
5614dcb4ea Support multiline comments and hopefully fix panic 2018-10-18 18:57:16 +02:00
Lukas Stevens
8753e568bf Check for comments in collapsible ifs 2018-10-18 18:00:21 +02:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
1264bb6b7d
Merge pull request #3323 from pengowen123/fix_manual_memcpy
Simplify manual_memcpy suggestion in some cases
2018-10-18 09:44:24 +02:00
Philipp Hansch
adbaa85ee9
Merge pull request #3330 from shssoichiro/3309-goblin-ice
Resolve ICE in needless range loop lint
2018-10-17 21:01:15 +02:00
Joshua Holmer
4b68c965fe Resolve ICE in needless range loop lint
An ICE would occur if the needless range loop was triggered
within a procedural macro, because Clippy would try to produce
a code suggestion which was invalid, and caused the compiler
to crash.

This commit takes the same approach which Clippy currently takes
to work around this type of crash in the needless pass by value lint,
which is to skip the lint if Clippy is inside of a macro.
2018-10-17 10:43:32 -04:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
f40c4fa51d
Merge pull request #3327 from phansch/update_changelog_riir
RIIR update_lints: Update changelog links
2018-10-17 09:47:02 +02:00
Philipp Hansch
9f3ac4e5a3
RIIR update_lints: Update changelog links
This now also updates the link list at the bottom of the changelog.
2018-10-17 08:18:05 +02:00
Philipp Hansch
284c63e84d
Merge pull request #3281 from CYBAI/redundant-match
Add lint for redundant pattern matching for explicit return boolean
2018-10-17 07:31:09 +02:00
Philipp Hansch
b0ab69fcf1
Merge pull request #3326 from mrbuzz/master
Reword help message for len_zero
2018-10-17 07:27:10 +02:00
CYBAI
66ae3b1249 Rename if_let_redundant_pattern_matching to redundant_pattern_matching
Also, making the old one deprecated
2018-10-17 11:20:42 +08:00
CYBAI
3b7c88888b Add lint for redundant pattern matching for explicit return boolean 2018-10-17 11:14:37 +08:00
Giorgio Gambino
aa88e68902 Fix issue #3322: reword help message for len_zero 2018-10-16 23:23:31 +02:00
Owen Sanchez
8c902d1cf2 Simplify manual_memcpy suggestion in some cases 2018-10-16 12:38:23 -07:00
Philipp Hansch
dae7abb16b
Merge pull request #3325 from phansch/riir_update_lints_first_replace_region
RIIR update_lints: Replace lint count in README.md
2018-10-16 21:35:25 +02:00
Philipp Hansch
05ffc2d057
Fix dogfood
`expect_fun_call` causes a false-positive, so I disabled it for now.
2018-10-16 20:58:00 +02:00
Joshua Holmer
33847b579e Update known problems for unnecessary_fold 2018-10-16 09:04:02 -04:00
Oliver S̶c̶h̶n̶e̶i̶d̶e̶r Scherer
6ae89c4f11
Merge pull request #3321 from 0ndorio/fix/1123_false_positive_on_boxed_local
Avoid linting `boxed_local` on trait implementations.
2018-10-16 10:45:55 +02:00
Philipp Hansch
956987f43e
RIIR update_lints: Replace lint count in README.md
This allows the usage of `util/dev update_lints` which will write the
new lint_count to the `README.md`.
2018-10-16 08:14:32 +02:00