Commit graph

5863 commits

Author SHA1 Message Date
Matthew Kraai
753c39672e Use lint pass macros
Fixes #3917.
2019-04-17 09:35:22 -07:00
Matthew Kraai
24bb63383a Document declare_lint_pass! 2019-04-17 06:51:21 -07:00
flip1995
ce87051779 Fix lint_without_lint_pass internal lint 2019-04-17 06:51:21 -07:00
bors
3e760cc93a Auto merge of #3926 - flip1995:def_path_uplift, r=phansch
Use {get,match}_def_path from rustc

This is a follow up of the uplift of `{get,match}_def_path` to rustc.

~~This is blocked on rust-lang/rust#59779~~
2019-04-17 11:09:25 +00:00
flip1995
840eac2c05
Use {get,match}_def_path from LateContext 2019-04-17 12:53:29 +02:00
flip1995
2f100e04af
Remove uplifted functions {get,match}_def_path from Clippy 2019-04-17 12:51:57 +02:00
bors
27d62cf603 Auto merge of #3966 - flip1995:internal_lints, r=oli-obk
Enable rustc internal lints

Closes #3965

I'm not 100% sure if enabling the `-Zunstable-options` flag in the `.cargo/config` file is the right place.
2019-04-17 04:46:19 +00:00
bors
ea25f044ec Auto merge of #3977 - phansch:add_rustfix_bool_comparison, r=flip1995
Add run-rustfix for bool_comparison lint

cc #3630
2019-04-17 02:35:02 +00:00
bors
1936368da1 Auto merge of #3976 - phansch:deref_addrof_rustfix, r=flip1995
Add run-rustfix for deref_addrof lint

* renames `tests/ui/reference.{rs,stderr}` to
  `tests/ui/deref_addrof.{rs,stderr}
* Moves small part of the testfile to a separate file as the lint
  triggered again on the fixed code (as intended)
* Adds `// run-rustfix` to `tests/ui/deref_addrof.rs`

cc #3630
2019-04-17 01:50:58 +00:00
bors
1132caabff Auto merge of #3975 - phansch:has_placeholders, r=flip1995
Change while_let_loop applicability to HasPlaceholders

The suggestion has been changed at some point to use `..` in the suggested code.
Due to that we can't make the lint MachineApplicable anymore.

cc #3630
2019-04-17 01:14:27 +00:00
bors
e4eee4baba Auto merge of #3972 - rust-lang:oli-obk-patch-1, r=flip1995,Manishearth
Create PULL_REQUEST_TEMPLATE

changelog: none

addresses https://github.com/rust-lang/rust-clippy/issues/3955#issuecomment-483567400
2019-04-16 23:52:59 +00:00
Philipp Hansch
90ddf0da6c
Add run-rustfix for bool_comparison lint 2019-04-16 20:42:54 +02:00
Philipp Hansch
d1e84c615c
Add run-rustfix for deref_addrof lint
* renames `tests/ui/reference.{rs,stderr}` to
  `tests/ui/deref_addrof.{rs,stderr}
* Moves small part of the testfile to a separate file as the lint
  triggered again on the fixed code (as intended)
* Adds `// run-rustfix` to `tests/ui/deref_addrof.rs`
2019-04-16 20:32:54 +02:00
Philipp Hansch
e974d84d03
while_let_loop uses placeholders in suggestions
Due to that we can't make the lint MachineApplicable anymore.
2019-04-16 20:05:16 +02:00
flip1995
118f7d54c4
Remove rust-toolchain file from clippy_dev 2019-04-16 17:17:07 +02:00
Oliver Scherer
3b0185be45
Update adding_lints.md 2019-04-16 15:16:08 +02:00
Oliver Scherer
d383a12deb
Update PULL_REQUEST_TEMPLATE 2019-04-16 15:15:19 +02:00
Oliver Scherer
f33cbc152d
Add new lint checklist 2019-04-16 13:30:46 +02:00
Oliver Scherer
275dbec86d
Create PULL_REQUEST_TEMPLATE 2019-04-16 11:04:42 +02:00
bors
3e8d992bd8 Auto merge of #3970 - rust-lang:map_copied, r=flip1995
Suggest .copied() instead of .cloned() in map_clone where applicable

partial fix for https://github.com/rust-lang/rust-clippy/issues/3958

changelog: Improve suggestion in `map_clone` to suggest `.copied()` where applicable
2019-04-16 07:29:35 +00:00
Manish Goregaokar
e9cde416ba Only suggest .copied() for Option right now 2019-04-15 15:44:09 -07:00
Manish Goregaokar
ad2c65bd1b Also suggest .copied() when .clone() is called on a Copy type 2019-04-15 14:39:41 -07:00
Manish Goregaokar
d2f7ae70ae Suggest .copied() instead of .cloned() in map_clone when dealing with references 2019-04-15 14:32:39 -07:00
flip1995
445fa3b529
Deny rustc internal lints 2019-04-15 13:21:52 +02:00
flip1995
5361b842d1
Remove clippy::default_hash_types internal lint 2019-04-15 13:21:52 +02:00
flip1995
0973f68fb8
Enable -Zunstable-options in .cargo/config 2019-04-15 13:03:07 +02:00
bors
fbb3a47b90 Auto merge of #3961 - rust-lang:rustup, r=matthiaskrgr
Rust upgrade to rustc 1.35.0-nightly (9cd61f025 2019-04-14)

Handles breakages from https://github.com/rust-lang/rust/pull/59877

r? @oli-obk @matthiaskrgr
2019-04-14 21:08:00 +00:00
Manish Goregaokar
2156f6733e Clean up unused cx parameters 2019-04-14 13:23:43 -07:00
Manish Goregaokar
3c93a95b1f HirIdify ReadVisitor 2019-04-14 13:18:34 -07:00
Manish Goregaokar
0c6956f8ce Use _from_hir_id APIs 2019-04-14 13:15:20 -07:00
Manish Goregaokar
1b2f2be085 Remove now-unnecessary calls to node_to_hir_id 2019-04-14 13:11:31 -07:00
bors
6505794bc6 Auto merge of #3960 - phansch:fix_except, r=flip1995
Remove `except` in suspicious_else_formatting

96c34e85 contains the fix:

This was causing two different ICEs in #3741. The first was fixed in #3925.

The second one is fixed with this commit: We just don't `expect` anymore.
If the snippet doesn't contain an `else`, we stop emitting the lint because
it's not a suspiciously formatted else anyway.

Unfortunately I wasn't able to provide a minimal test case, but I think it's
fine since it's just ignoring the `None` case now.

And ad27e3ff cleans up the lint code to use `if_chain`.

Fixes #3741 once more.
2019-04-14 15:56:58 +00:00
bors
422ae77cae Auto merge of #3956 - rust-lang:beta-clog, r=phansch
Beta changelog

Maintain a changelog for beta so the release team can easily include important additions in the release blog posts.

r? @phansch, @oli-obk
2019-04-14 15:17:40 +00:00
Manish Goregaokar
737e45ad2d Link to ICEs 2019-04-14 08:17:01 -07:00
Philipp Hansch
02afbb9d61 Update CHANGELOG.md
Co-Authored-By: Manishearth <manishsmail@gmail.com>
2019-04-14 08:14:48 -07:00
Philipp Hansch
289a9af801
cargo fmt 2019-04-14 15:07:15 +02:00
bors
b1f05de7c5 Auto merge of #3951 - phansch:add_combine_integration_test, r=phansch
Add Marwes/combine to integration tests

repo link: https://github.com/Marwes/combine

`combine` uses a lot of macros internally, has been downloaded more than 200_000
times and is also a dependency of [`redis-rs`](https://crates.io/crates/redis).

Clippy also previously ICEd on combine in #3747 so I think it would be
good to have this crate as an integration test.
2019-04-14 09:46:47 +00:00
Philipp Hansch
ad27e3ff9b
Refactor suspicious_else_formatting using if_chain 2019-04-14 11:12:51 +02:00
Philipp Hansch
96c34e85c4
Remove except in suspicious_else_formatting
This was causing two different ICEs in #3741.
The first was fixed in #3925.

The second one is fixed with this commit: We just don't `expect`
anymore. If the snippet doesn't contain an `else`, we stop emitting the
lint because it's not a suspiciously formatted else anyway.
2019-04-14 11:04:41 +02:00
bors
d19b66e900 Auto merge of #3959 - rust-lang:rustup, r=phansch
Rust upgrade to rustc 1.35.0-nightly (00856722b 2019-04-13)

r? @phansch @oli-obk
2019-04-14 09:00:33 +00:00
Manish Goregaokar
1366b9516b Rust upgrade to rustc 1.35.0-nightly (00856722b 2019-04-13) 2019-04-13 18:57:16 -07:00
Manish Goregaokar
22b9366e75 Beta changelog 2019-04-13 15:05:25 -07:00
bors
5939b6131f Auto merge of #3950 - phansch:update_changelog, r=Manishearth
Update changelog for Rust 1.34.0

[Rendered](https://github.com/phansch/rust-clippy/blob/update_changelog/CHANGELOG.md#rust-134-2019-04-10)
2019-04-13 17:52:25 +00:00
Philipp Hansch
4e72d1eb8c
Add Marwes/combine to integration tests
repo link: https://github.com/Marwes/combine

`combine` uses a lot of macros internally, has been downloaded more than 200_000
times and is also a dependency of [`redis-rs`](https://crates.io/crates/redis).

Clippy also previously ICEd on combine in #3747 so I think it would be
good to have this crate as an integration test.
2019-04-13 13:21:14 +02:00
Philipp Hansch
745d6fb74b
Mention configuration option for too_many_lines lint 2019-04-13 11:04:58 +02:00
Philipp Hansch
543858d741
Update changelog for Rust 1.34.0 2019-04-13 09:55:48 +02:00
bors
d516925ec8 Auto merge of #3946 - rchaser53:issue-3920, r=flip1995
fix format does not parse escaped braces error

related: https://github.com/rust-lang/rust-clippy/issues/3920
2019-04-12 17:03:01 +00:00
rchaser53
db6ca9b8d3 fix format does not parse escaped braces error 2019-04-13 01:39:10 +09:00
bors
abf7f911d8 Auto merge of #3945 - flip1995:rustup, r=phansch
Rustup

cc https://github.com/rust-lang/rust/pull/59227#issuecomment-482411861

This fix is obsolet once rust-lang/rust#59779 and #3926 is merged.
2019-04-12 11:53:08 +00:00
flip1995
3fe5eea4e4
Fix get_def_path
This fix is obsolet once rust-lang/rust#59779 and #3926 is merged.
2019-04-12 11:59:06 +02:00