Commit graph

8581 commits

Author SHA1 Message Date
flip1995
7fd3bd0f57 Register redundant_field_names and non_expressive_names as early passes 2020-05-26 21:41:51 +02:00
bors
f28c6de106 Auto merge of #5648 - returntrip:master, r=matthiaskrgr
Add license symlink

To make it easier for Linux distributions to ship the licenses text within the rustc_tools_util crate directory.

changelog: none
2020-05-26 15:23:50 +00: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
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
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
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
returntrip
f2154e9837 To make it easier for Linux distributions, ship the licenses text within
each crate directory.
2020-05-25 23:06:08 +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
Eduardo Broto
60d38ee1dd reversed_empty_ranges: add suggestion for &slice[N..N] 2020-05-25 20:06:15 +02: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