Commit graph

8575 commits

Author SHA1 Message Date
Philipp Hansch
fd86b3150e
Be less specific about quote and syn versions 2020-05-26 16:52:02 +02:00
Philipp Hansch
cdff59e156
Using dev-dependencies doesn't seem to work w/ compiletest 2020-05-26 16:52:02 +02:00
Philipp Hansch
e3f6a8fc20
Specify quote and syn versions 2020-05-26 16:52:02 +02:00
Philipp Hansch
67167be167
Make empty_line_after_outer_attr an early lint 2020-05-26 16:52:02 +02:00
bors
578692d9b0 Auto merge of #5562 - flip1995:clippyup_up, r=phansch
Update contributing section about syncing Clippy

[Rendered](https://github.com/flip1995/rust-clippy/blob/clippyup_up/CONTRIBUTING.md#fixing-build-failures-caused-by-rust)

r? @oli-obk Did I get the sync process right?

changelog: none
2020-05-26 11:42:15 +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
bors
dd06d2983f Auto merge of #4429 - jeremystucki:or_fun_call, r=flip1995
Update 'or_fun_call' to ignore calls to len

Resolves #1653

changelog: Update `or_fun_call`: Allow calls to `len` for Slice, Array & Vec.
2020-05-25 20:15:34 +00:00
Jeremy Stucki
d9f55322cc
Update ui test 2020-05-25 21:41:28 +02:00
Jeremy Stucki
bcfeb4de15
Fix build 2020-05-25 21:41:20 +02:00
Jeremy Stucki
566377f627
Ignore calls to 'len' 2020-05-25 21:41:20 +02:00
Jeremy Stucki
6bd9cd99a3
Add tests 2020-05-25 21:41:19 +02:00
bors
acd484e51d Auto merge of #5641 - ThibsG:DocCommonTools, r=flip1995
Add common lint tools doc

This PR starts adding some documentation about linting tools.

`Retrieving all methods of a type` is not covered at this time.

fixes partially: #3843

changelog: none
2020-05-25 19:33:52 +00: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
ThibsG
827041252c Add common lint tools doc 2020-05-25 20:03:55 +02:00
Eduardo Broto
ec0a00e539 Use find_map instead of find() + map() 2020-05-25 20:00:08 +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
bors
7ca335a97d Auto merge of #5639 - nickrtorres:unnecessary-mut-passed-doc-cleanup, r=phansch
Clarify the documentation of the `unnecessary_mut_passed` lint

fixes #5433 by replacing "giving" with "passing"

changelog: Clarifies documentation for `unnecessary_mut_passed`
2020-05-25 17:02:12 +00:00
bors
f162dc3ea0 Auto merge of #5646 - flip1995:rustup, r=matthiaskrgr
Rustup

r? @phansch

changelog: none
2020-05-25 16:42:50 +00:00
Philipp Krones
7a83eafd44
Also fetch origin before merging master into the rustup branch 2020-05-25 17:11:07 +02:00
Nick Torres
a709559705 Clarify the documentation of the unnecessary_mut_passed lint 2020-05-23 16:15:30 -07:00
Dylan MacKenzie
b3a690f5a1 Use OnceCell instead of Once 2020-05-22 13:31:02 -07: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
bors
ce86f907ef Auto merge of #5632 - flip1995:rustup, r=phansch
Rustup

changelog: none
2020-05-22 13:00:38 +00:00
flip1995
6b3cf63bf5
Fix dogfood fallout 2020-05-22 14:45:51 +02:00
flip1995
c00268d984
Also install llvm-tools on toolchain setup 2020-05-22 14:08:21 +02:00
bors
780572bc8d Auto merge of #5614 - ebroto:test_cargo_lints, r=flip1995
Test cargo lints

changelog: Add infrastructure to test cargo lints

Closes #5603
2020-05-21 14:43:56 +00: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
1a04686fc0 Avoid triggering match_wildcard_for_single_variants 2020-05-21 14:47:13 +02:00
Eduardo Broto
7ff71199df Address comments from PR review 2020-05-21 14:46:04 +02:00
Eduardo Broto
5d0135e222 Add documentation for testing cargo lints 2020-05-21 14:11:11 +02:00
Eduardo Broto
1eb6adf475 Adapt cargo dev new_lint to create tests for cargo lints 2020-05-21 14:11:11 +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
bors
1831385ff0 Auto merge of #5611 - rrbutani:master, r=flip1995
Add to the list of words clippy::doc_markdown ignores

"TypeScript" is the only one of these I actually ran into organically; I can remove the others if they're too much.

changelog: Add to the list of words `clippy::doc_markdown` ignores
2020-05-20 14:15:12 +00:00
bors
20f09e1daa Auto merge of #5622 - elichai:2020-05-match_wild_err_arm, r=flip1995
Downgrade `match_wild_err_arm` to pedantic and update help messages

Hi,
This fixes #3688 and downgrades `match_wild_err_arm` to pedantic.
There are a lot of different reasons in that issue, for me the biggest are:
1. Rust's errors aren't like Java's exceptions because they're type safe and in most cases the type of error can't change by itself.
2. Sometimes matching can be more ergonomic, and before the `track_caller` feature got introduced it was actually easier to track the panic location with explicit `panic!` than with `expect`.

Currently clippy is failing to build because of a breaking change in https://github.com/rust-lang/rust/pull/69171 I tried fixing it but it is too complex for my little knowledge of clippy and rustc so I'll leave that to people who know what they're doing :)

Another thing, if rustc is breaking clippy a lot then maybe it's better to use something like `miri` does, where it's hard codes the latest tested rustc commit and they keep bumping it, that way when you develop locally it should work even if there was a breaking change (https://github.com/rust-lang/miri/blob/master/rustup-toolchain#L23-L29)

changelog: Downgrade `match_wild_err_arm` to pedantic
2020-05-20 14:02:06 +00:00
Elichai Turkel
2db7f1abf8
Update future-not-send stderr output 2020-05-20 16:46:30 +03:00
Bastian Kauschke
091239ee60 introduce newtype'd Predicate<'tcx> 2020-05-20 15:44:34 +02:00
Elichai Turkel
ecd0a67b01
Make match_wild_err_arm pedantic, and update help messages 2020-05-20 16:39:03 +03:00
Bastian Kauschke
2722522fac rename Predicate to PredicateKind, introduce alias 2020-05-20 15:38:03 +02: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
bors
34ba597ccb Auto merge of #5621 - flip1995:rustup, r=phansch
Rustup

@oli-obk Do you know, how we can enforce (ui-)tests pass in rust-lang/rust for Clippy? I can open a PR for this, if you tell me what would be necessary for this.

changelog: none
2020-05-20 12:09:24 +00:00
flip1995
f28f1f15da
Fix dogfood fallout 2020-05-20 13:32:53 +02:00
flip1995
da9b138ec7
Update test after const_ptr functions are must_use now 2020-05-20 13:25:20 +02:00