Commit Graph

4719 Commits

Author SHA1 Message Date
bors[bot]
9d69da7d0e Merge #3362
3362: travis: work around temporary test failure due to rustc crashing on hyper r=phansch a=matthiaskrgr

Upstream ticket: https://github.com/rust-lang/rust/issues/55376

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
2018-10-26 08:01:48 +00:00
Matthias Krüger
326270ad12 travis: work around temporary test failure due to rustc crashing on hyper.
Upstream ticket: https://github.com/rust-lang/rust/issues/55376
2018-10-26 09:57:20 +02:00
bors[bot]
4a7601bd55 Merge #3358
3358: Revert "new_ret_no_self: add sample from #3313 to Known Problems section." r=oli-obk a=matthiaskrgr

This reverts commit fd2f6dd382.

Issue #3313 has been fixed.

Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
2018-10-25 11:43:09 +00:00
Matthias Krüger
b8a9099011 Revert "new_ret_no_self: add sample from #3313 to Known Problems section."
This reverts commit fd2f6dd382.

Issue #3313 has been fixed.
2018-10-25 13:39:02 +02:00
bors[bot]
a87e1b02ab Merge #3331
3331: Disable arithmetic lints in constant items r=oli-obk a=pengowen123

Currently this will not catch cases in associated constants. I'm not sure whether checking spans is the best way to solve this issue, but I don't think it will cause any problems.
Fixes #1858

Co-authored-by: Owen Sanchez <pengowen816@gmail.com>
2018-10-25 09:38:00 +00:00
bors[bot]
757750d389 Merge #3346
3346: Add lint for calling `mem::discriminant` on a non-enum type r=flip1995 a=HMPerson1

Also, if the type is a reference to an enum, we suggest removing `&`s and/or dereferencing.

Fixes #3342

Co-authored-by: HMPerson1 <hmperson1@gmail.com>
Co-authored-by: Philipp Krones <hello@philkrones.com>
2018-10-25 06:43:32 +00:00
HMPerson1
d53e6f87e9
Add tests for more than one level of reference 2018-10-24 23:39:55 -04:00
HMPerson1
1a6bfecf38
Add test case for mem::discriminant inside a macro 2018-10-24 23:39:55 -04:00
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
Owen Sanchez
0b9e9c9e3d Disable arithmetic lints in constant items 2018-10-24 20:27:26 -07: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