Commit graph

3425 commits

Author SHA1 Message Date
Matthias Krüger 2de290d5c5 duration-subsec: make lint adhere to lint message convention 2020-08-11 16:31:02 +02:00
Matthias Krüger 423615693b pub-enum-variant-names: make lint adhere to lint message convention 2020-08-11 16:28:05 +02:00
Matthias Krüger 1f17c3b02b multiple_inherent_impl: make lint adhere to lint message convention 2020-08-11 15:28:51 +02:00
Matthias Krüger bdf4dc3abd implicit-saturating-sub: make lint adhere to lint message convention 2020-08-11 15:22:59 +02:00
Matthias Krüger f171f89aed int_plus_one: make lint adhere to lint message convention 2020-08-11 15:15:26 +02:00
Matthias Krüger 6af297f80e iter-next-slice: make lint adhere to lint message convention 2020-08-11 15:15:26 +02:00
Matthias Krüger 04867e004e mutex-atomic: make lint adhere to lint message convention 2020-08-11 15:15:26 +02:00
Matthias Krüger ac194cafc1 map_clone: make lint adhere to lint message convention 2020-08-11 15:15:26 +02:00
Matthias Krüger c0a9d64818 stable-sort-primitive: make lint adhere to lint message convention 2020-08-11 15:15:26 +02:00
bors 3337f7956c Auto merge of #5892 - matthiaskrgr:redundant_mut, r=flip1995
unnecessary-mut-passed: make lint message say if fn is a function or a method

changelog: refine "unnecessary-mut-passed" lint message
2020-08-11 12:52:41 +00:00
bors 09bd400243 Auto merge of #5891 - flip1995:rustup, r=flip1995
Rustup

r? @ghost

Sync back rust-lang/rust#75098

changelog: none
2020-08-11 12:32:10 +00:00
flip1995 9311c11d7c
Fix sync fallout 2020-08-11 14:21:27 +02:00
Matthias Krüger b8713e3854 unnecessary-mut-passed: make lint message say if fn is a function or a method. 2020-08-11 14:16:56 +02:00
Dylan DPC 9e73d33680 Rollup merge of #75098 - Ryan1729:clippy-pointer-cast-lint-experiment, r=oli-obk
Clippy pointer cast lint experiment

This PR is an experiment about exposing more parts of `rustc_typeck` for use in `clippy`. In particular, the code that checks where a cast is valid or not was exposed, which necessitated exposing [`FnCtxt`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_typeck/check/struct.FnCtxt.html), and figuring out how to create an instance of that type inside `clippy`.

This was prompted by [this clippy issue](https://github.com/rust-lang/rust-clippy/issues/2064).

r? @oli-obk
2020-08-11 01:56:30 +02:00
bors cc5bfd473c Auto merge of #5888 - matthiaskrgr:lints, r=yaahc
make a bunch of lints texts adhere to rustc dev guide

According to the rustc-dev guide: "The text should be matter of fact and avoid capitalization and periods, unless multiple sentences are needed"

changelog: make some lint output adhere to the rustc-dev guide
2020-08-10 22:40:42 +00:00
Matthias Krüger 6d0b5e24df update test stderr 2020-08-11 00:27:55 +02:00
Matthias Krüger dabf989195 neg-cmp-op-on-partial-ord: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 178da9b2ef neg-multiply: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger e519bb3c85 overflow-check-conditional: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 9178363574 path-buf-push-overwrite: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 81f77a411e range-zip-with-len: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 3e1e0c9bdb redundant-static-lifetimes: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 5d69ca5e11 also change "deprecated-attribute" message 2020-08-10 23:49:06 +02:00
Matthias Krüger fe37ddbd11 suspicious-arithmetic-impl: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 7954c22a99 unknown: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger b36a6c9594 ref_in_deref: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 4418ff122f unneeded-field-pattern: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 2792260636 empty-liner-after-outer-attr: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 0db5cb1393 drop_bounds: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 590b91d8d4 double-parens: make lint adhere to lint message convention and do minor refactoring 2020-08-10 23:49:06 +02:00
Matthias Krüger ba7a01a6a8 double-comparisons: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 6b0a6a70f8 default-trait-access: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 3d592b5154 cmp_null: make lint adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 8679dd375b unnecessary_unwrap, panicking_unwrap: make lints adhere to lint message convention 2020-08-10 23:49:06 +02:00
Matthias Krüger 9b7ab1d38b checked-conversions: make lint adhere to lint message convention 2020-08-10 23:48:57 +02:00
Eduardo Broto 5d66bd7bb3 Avoid or_fun_call for const_fn with no args 2020-08-10 23:38:58 +02:00
Matthias Krüger 40416c0fa8 naive_bytecount: make lint adhere to lint message convention 2020-08-10 20:55:23 +02:00
Matthias Krüger fd379a889e builtin-type-shadow: make lint adhere to lint message convention 2020-08-10 20:55:23 +02:00
Matthias Krüger 0876f17d77 bool-comparison: make lint adhere to lint message convention 2020-08-10 20:55:23 +02:00
Matthias Krüger e57aafe33f too-many-lines: make lint adhere to lint message convention 2020-08-10 20:55:23 +02:00
Philipp Krones ee8db50e13
Rollup merge of #5871 - wiomoc:feature/methodcall-minmax, r=flip1995
Lint .min(x).max(y) with x < y

Fixes  #5854

changelog: Also lint `ord.min(a).max(b)`, where `a < b` in [`min_max`] lint
2020-08-10 14:56:29 +02:00
Philipp Krones 08ab29bed1
Rollup merge of #5870 - ebroto:5789_allow_unsafe_derive_deserialize, r=flip1995
enable #[allow(clippy::unsafe_derive_deserialize)]

Before this change this lint could not be allowed as the code we are checking is automatically generated.

changelog: Enable using the `allow` attribute on top of an ADT linted by [`unsafe_derive_deserialize`].

Fixes: #5789
2020-08-10 14:56:27 +02:00
Philipp Krones 8ee57eed79
Rollup merge of #5869 - wiomoc:feature/implicit-self, r=ebroto,flip1995
New lint against `Self` as an arbitrary self type

Fixes #5861

changelog: * [`needless_arbitrary_self_type`] [#5869](https://github.com/rust-lang/rust-clippy/pull/5869)
2020-08-10 14:56:26 +02:00
Philipp Krones 9da5b6d1d0
Rollup merge of #5825 - giraffate:same_item_push, r=Manishearth
Add the new lint `same_item_push`

changelog: Add the new lint `same_item_push`

Fixed #4078. As I said in https://github.com/rust-lang/rust-clippy/issues/4078#issuecomment-658184195, I referrerd to https://github.com/rust-lang/rust-clippy/pull/4647.
2020-08-10 14:56:25 +02:00
Ryan1729 873e5f5c19 add allow unused_unsafe and allow dead_code 2020-08-09 00:39:14 -06:00
Ryan1729 bc8d32d36b fix unary minus on usize and unused variable errors in .fixed file 2020-08-09 00:28:56 -06:00
Ryan1729 84db238fa1 add a test example of where transmutes_expressible_as_ptr_casts should not suggest anything 2020-08-09 00:15:56 -06:00
Ryan1729 a1ca12581a update stderr for transmutes_expressible_as_ptr_casts 2020-08-08 21:03:41 -06:00
bors 70c46de012 Auto merge of #5877 - ebroto:5872_loops_ice, r=Manishearth
Fix ICE in `loops` module

changelog: Fix ICE related to `needless_collect` when a call to `iter()` was not present.

I went for restoring the old suggestion of `next().is_some()` over `get(0).is_some()` given that `iter()` is not necessarily present (could be e.g. `into_iter()` or `iter_mut()`)  and that the old suggestion could change semantics, e.g. a call to `filter()` could be present between `iter()` and the collect part.

Fixes #5872
2020-08-08 18:44:48 +00:00
bors 3899d6001c Auto merge of #5878 - flip1995:rustup, r=flip1995
Rustup

r? @ghost

changelog: none
2020-08-08 17:28:34 +00:00