]>
git.lizzy.rs Git - rust.git/log
Dharma Saputra Wijaya [Tue, 25 Jan 2022 14:19:19 +0000 (22:19 +0800)]
fix bad suggestion on `numeric_literal`
bors [Tue, 25 Jan 2022 13:08:10 +0000 (13:08 +0000)]
Auto merge of #8343 - robjtede:patch-1, r=giraffate
Autofocus search input
changelog: autofocus filter input on Clippy Lints page
Rob Ede [Mon, 24 Jan 2022 11:36:15 +0000 (11:36 +0000)]
Autofocus search input
bors [Mon, 24 Jan 2022 00:03:40 +0000 (00:03 +0000)]
Auto merge of #8315 - dswij:8306, r=giraffate
`trait_duplication_in_bounds` checks path segments for trait items
closes #8306
changelog: [`trait_duplication_in_bounds`] Fix FP when path segments exists for trait items
bors [Sun, 23 Jan 2022 12:59:52 +0000 (12:59 +0000)]
Auto merge of #8311 - dswij:8277, r=llogiq
fix `needless_question_mark` not considering async fn
closes #8277
changelog: [`needless_question_mark`] Fix FN on async functions
dswij [Tue, 18 Jan 2022 10:41:00 +0000 (18:41 +0800)]
fix `needless_question_mark` not considering async fn
bors [Sun, 23 Jan 2022 03:01:39 +0000 (03:01 +0000)]
Auto merge of #8217 - Jarcho:needless_borrow_8191, r=camsteffen
Fix `needless_borrow` causing mutable borrows to be moved
fixes #8191
changelog: Fix `needless_borrow` causing mutable borrows to be moved
changelog: Rename `ref_in_deref` to `needless_borrow`
changelog: Suggest removing the borrow on method call receivers in `needless_borrow`
Jason Newcomb [Wed, 12 Jan 2022 00:44:33 +0000 (19:44 -0500)]
Subsume `ref_in_deref` into `needless_borrow`
Jason Newcomb [Tue, 11 Jan 2022 19:31:35 +0000 (14:31 -0500)]
Remove final reference on fields and method calls in `needless_borrow`
bors [Sat, 22 Jan 2022 13:00:39 +0000 (13:00 +0000)]
Auto merge of #8278 - Alexendoo:needless-lifetime-explicit-self-ty, r=xFrednet
`needless_lifetimes`: ignore lifetimes in explicit self types
changelog: false positive fix: [`needless_lifetimes`] no longer lints lifetimes in explicit self types
They're not currently elidable (https://github.com/rust-lang/rust/issues/69064)
Fixes #7296
Alex Macleod [Fri, 14 Jan 2022 14:24:25 +0000 (14:24 +0000)]
`needless_lifetimes`: ignore lifetimes in explicit self types
bors [Sat, 22 Jan 2022 04:49:41 +0000 (04:49 +0000)]
Auto merge of #8332 - Jarcho:clear_test_results, r=camsteffen
Don't bless outdated files on windows
changelog: None
Jason Newcomb [Sat, 22 Jan 2022 04:11:32 +0000 (23:11 -0500)]
Don't bless outdated files on windows
bors [Fri, 21 Jan 2022 15:43:57 +0000 (15:43 +0000)]
Auto merge of #8271 - Jarcho:ptr_arg_214, r=flip1995
Check usages in `ptr_arg`
fixes #214
fixes #1981
fixes #3381
fixes #6406
fixes #6964
This does not take into account the return type of the function currently, so `(&Vec<_>) -> &Vec<_>` functions may still be false positives.
The name given for the type also has to match the real type name, so `type Foo = Vec<u32>` won't trigger the lint, but `type Vec = Vec<u32>` will. I'm not sure if this is the best way to handle this, or if a note about the actual type should be added instead.
changelog: Check if the argument is used in a way which requires the original type in `ptr_arg`
changelog: Lint mutable references in `ptr_arg`
Jason Newcomb [Mon, 3 Jan 2022 17:44:33 +0000 (12:44 -0500)]
Fix `needless_borrow` causing mutable borrows to be moved
Jason Newcomb [Fri, 21 Jan 2022 14:43:41 +0000 (09:43 -0500)]
`ptr_arg` cleanup
bors [Fri, 21 Jan 2022 13:37:18 +0000 (13:37 +0000)]
Auto merge of #8329 - Alexendoo:enum-variant-names, r=giraffate
Don't suggest an empty variant name in `enum_variant_names`
changelog: false positive fix: [`enum_variant_names`]: No longer suggests an empty variant name
Fixes #8324
Alex Macleod [Fri, 21 Jan 2022 12:40:33 +0000 (12:40 +0000)]
Don't suggest an empty variant name in `enum_variant_names`
dswij [Thu, 20 Jan 2022 05:38:48 +0000 (13:38 +0800)]
`trait_duplication_in_bounds` checks path segments for trait items
bors [Wed, 19 Jan 2022 16:33:10 +0000 (16:33 +0000)]
Auto merge of #8280 - xFrednet:8276-map-clone-msrv, r=flip1995
Add `msrv` config for `map_clone`
Just a small PR to have some fun with Clippy and to clear my head a bit :sweat_smile:
---
changelog: [`map_clone`]: The suggestion takes `msrv` into account
changelog: Track `msrv` attribute for `manual_bits` and `borrow_as_prt`
fixes: #8276
bors [Wed, 19 Jan 2022 08:55:40 +0000 (08:55 +0000)]
Auto merge of #8304 - camsteffen:test-tweaks, r=flip1995
Remove __CLIPPY_INTERNAL_TESTS env var
changelog: none
It doesn't have any effect AFAICT.
bors [Wed, 19 Jan 2022 01:23:15 +0000 (01:23 +0000)]
Auto merge of #8310 - camelid:rm-stringification, r=Manishearth
Remove unnecessary `Symbol` stringification
This should (slightly) improve performance and enhance code quality.
changelog: none
Noah Lev [Wed, 19 Jan 2022 00:17:43 +0000 (16:17 -0800)]
Remove unnecessary `Symbol` stringification
This should (slightly) improve performance and enhance code quality.
bors [Tue, 18 Jan 2022 00:12:42 +0000 (00:12 +0000)]
Auto merge of #8298 - ebobrow:op_ref_fp, r=giraffate
fix op_ref false positive
fixes #7572
changelog: `op_ref` don't lint for unnecessary reference in BinOp impl if removing the reference will lead to unconditional recursion
Cameron Steffen [Wed, 12 Jan 2022 19:27:51 +0000 (13:27 -0600)]
Remove __CLIPPY_INTERNAL_TESTS env var
bors [Mon, 17 Jan 2022 12:08:30 +0000 (12:08 +0000)]
Auto merge of #8292 - marekdownar:8239, r=xFrednet
issue #8239: Printed hint for lint or_fun_call is cropped and does no…
fixes rust-lang/rust-clippy#8239
changelog: [`or_fun_call`]: if suggestion contains more lines than MAX_SUGGESTION_HIGHLIGHT_LINES it is stripped to one line
bors [Mon, 17 Jan 2022 11:35:58 +0000 (11:35 +0000)]
Auto merge of #8302 - xFrednet:0000-move-return-self-not-must-use, r=flip1995
Move `return_self_not_must_use` to `pedantic`
r? `@flip1995`
changelog: none
xFrednet [Mon, 17 Jan 2022 11:25:38 +0000 (12:25 +0100)]
Move `return_self_not_must_use` to `pedantic`
Marek Downar [Mon, 17 Jan 2022 11:34:03 +0000 (12:34 +0100)]
removing unsafe from test fn's && renaming shrink to sugg_span
bors [Mon, 17 Jan 2022 07:04:06 +0000 (07:04 +0000)]
Auto merge of #8299 - marekdownar:8214, r=Manishearth
#8214 cmp_owned suggestion flips the comparison
changelog: ``[`cmp_owned`]`` fixes #8214 so that the suggestion does not flip the comparison
bors [Mon, 17 Jan 2022 06:48:01 +0000 (06:48 +0000)]
Auto merge of #8297 - Jarcho:if_same_then_else_7579, r=Manishearth
Don't lint `if_same_then_else` with `if let` conditions
fixes #7579
changelog: Don't lint `if_same_then_else` with `if let` conditions
Jason Newcomb [Sun, 16 Jan 2022 14:46:02 +0000 (09:46 -0500)]
Don't lint `if_same_then_else` with `if let` conditions
bors [Sun, 16 Jan 2022 20:02:28 +0000 (20:02 +0000)]
Auto merge of #8203 - pmnoxx:piotr-next-lint, r=llogiq
New lint: `iter_overeager_cloned`
Closes #8202
changelog: New lint: [`iter_overeager_cloned`]
Marek Downar [Sun, 16 Jan 2022 19:27:00 +0000 (20:27 +0100)]
#8214 cmp_owned suggestion flips the comparison
Piotr Mikulski [Sun, 16 Jan 2022 18:32:45 +0000 (10:32 -0800)]
Fix tests
Piotr Mikulski [Sun, 16 Jan 2022 18:19:48 +0000 (10:19 -0800)]
Fix clippy warnings
Piotr Mikulski [Fri, 31 Dec 2021 06:39:53 +0000 (22:39 -0800)]
New line: cloned_next
Elliot Bobrow [Sun, 16 Jan 2022 17:17:22 +0000 (09:17 -0800)]
fix op_ref false positive
bors [Sun, 16 Jan 2022 13:24:08 +0000 (13:24 +0000)]
Auto merge of #8295 - Jarcho:useless_format_8290, r=giraffate
Handle implicit named arguments in `useless_format`
fixes #8290
Ideally this would fix the macro parsing code to handle this, but this is a smaller change and easier to back port.
changelog: Handle implicit named arguments in `useless_format`
bors [Sun, 16 Jan 2022 12:33:08 +0000 (12:33 +0000)]
Auto merge of #8284 - xFrednet:0000-update-copyright-year-i-am-procrastinating, r=giraffate
Update copyright year for Clippy (2022 edition)
At this point, I'm just searching for small things to do instead of sleeping or working on my bachelor thesis. :sweat_smile: Taking one day off will be fine :upside_down_face:
changelog: none
bors [Sat, 15 Jan 2022 22:17:37 +0000 (22:17 +0000)]
Auto merge of #8274 - andrewarchi:master, r=camsteffen
Update markdown-it version
Fixes improperly-escaped pipes in Markdown tables for the [documentation of bad_bit_mask](https://rust-lang.github.io/rust-clippy/master/index.html#bad_bit_mask) and [ineffective_bit_mask](https://rust-lang.github.io/rust-clippy/master/index.html#ineffective_bit_mask). A column pipe takes precedence over inline code markers, so some back ticks are displayed literally and the pipes need to be escaped. I found no other occurrences of the same problem when searching rust-clippy by ```\|.*`.*\|```.
changelog: Update markdown-it version
Jason Newcomb [Sat, 15 Jan 2022 19:33:43 +0000 (14:33 -0500)]
Handle implicit named arguments in `useless_format`
Marek Downar [Sat, 15 Jan 2022 21:19:01 +0000 (22:19 +0100)]
issue #8239: fix to prev commit && 4 test cases
Marek Downar [Sat, 15 Jan 2022 14:51:46 +0000 (15:51 +0100)]
issue #8239: Printed hint for lint or_fun_call is cropped and does not show the solution
bors [Sat, 15 Jan 2022 05:31:46 +0000 (05:31 +0000)]
Auto merge of #8287 - Jarcho:iter_not_returning_iterator_8285, r=Manishearth
Erase late bound regions in `iter_not_returning_iterator`
fixes #8285
changelog: None
Jason Newcomb [Sat, 15 Jan 2022 05:15:25 +0000 (00:15 -0500)]
Erase late bound regions in `iter_not_returning_iterator`
xFrednet [Sat, 15 Jan 2022 00:16:00 +0000 (01:16 +0100)]
Update copyright year for Clippy (2022 edition)
xFrednet [Fri, 14 Jan 2022 23:39:06 +0000 (00:39 +0100)]
Track `msrv` attribute for `manual_bits` and `borrow_as_prt`
xFrednet [Fri, 14 Jan 2022 22:45:05 +0000 (23:45 +0100)]
Add `msrv` config for `map_clone`
bors [Fri, 14 Jan 2022 22:17:29 +0000 (22:17 +0000)]
Auto merge of #8231 - Jarcho:implicit_clone_8227, r=camsteffen
Fix `implicit_clone` for `&&T`
fixes #8227
changelog: Don't lint `implicit_clone` on `&&T`
Andrew Archibald [Fri, 14 Jan 2022 03:01:56 +0000 (20:01 -0700)]
Update markdown-it version
Andrew Archibald [Thu, 13 Jan 2022 20:20:30 +0000 (13:20 -0700)]
Escape pipes in Markdown tables
bors [Thu, 13 Jan 2022 18:51:19 +0000 (18:51 +0000)]
Auto merge of #8273 - SeeSpring:apply_not_unsafe_ptr_arg_deref_to_type_aliases, r=llogiq
Apply `not_unsafe_ptr_arg_deref` to type aliases
changelog: Apply [`not_unsafe_ptr_arg_deref`] to type aliases
SeeSpring [Thu, 13 Jan 2022 14:27:08 +0000 (09:27 -0500)]
Apply `not_unsafe_ptr_arg_deref` to type aliases
bors [Thu, 13 Jan 2022 11:55:36 +0000 (11:55 +0000)]
Auto merge of #8272 - flip1995:rustup, r=flip1995
Rustup
r? `@ghost`
changelog: none
flip1995 [Thu, 13 Jan 2022 11:48:17 +0000 (12:48 +0100)]
Bump nightly version -> 2022-01-13
flip1995 [Thu, 13 Jan 2022 11:48:08 +0000 (12:48 +0100)]
Bump Clippy Version -> 0.1.60
flip1995 [Thu, 13 Jan 2022 11:11:21 +0000 (12:11 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup
Jason Newcomb [Sun, 9 Jan 2022 14:35:55 +0000 (09:35 -0500)]
Changes to `ptr_arg`
* Track the argument when used to initialize simple `let` bindings
* Check if the argument is passed to a function requiring the original type
* Use `multipart_suggestion` rather than multiple suggestions
* Check if the name given in the source code matches the name of the actual type
bors [Wed, 12 Jan 2022 18:44:34 +0000 (18:44 +0000)]
Auto merge of #8226 - Jarcho:manual_memcpy_8160, r=flip1995
`manual_memcpy` fix
fixes #8160
Ideally this would work with `VecDeque`, but the current interface is unsuitable for it. At a minimum something like `range_as_slices` would be needed.
changelog: Don't lint `manual_memcpy` on `VecDeque`
changelog: Suggest `copy_from_slice` for `manual_memcpy` when applicable
Jason Newcomb [Wed, 5 Jan 2022 23:27:10 +0000 (18:27 -0500)]
Suggest deref when needed in `implicit_clone`
Jason Newcomb [Wed, 12 Jan 2022 17:33:47 +0000 (12:33 -0500)]
Add `manual_memcpy_test` for `VecDeque`
bors [Wed, 12 Jan 2022 17:19:58 +0000 (17:19 +0000)]
Auto merge of #8266 - camsteffen:test-tweaks, r=flip1995
Some test code cleanup
changelog: none
Mainly moves /clippy_workspace_tests into /tests and combines the two dogfood tests which can't run concurrently.
bors [Wed, 12 Jan 2022 17:03:52 +0000 (17:03 +0000)]
Auto merge of #8265 - camsteffen:which-rustfmt, r=xFrednet
Cache rustfmt path
changelog: none
Call `rustup which rustfmt` and use the output. This shaves off ~0.7 seconds for `cargo dev fmt` for me.
Cameron Steffen [Wed, 12 Jan 2022 16:46:05 +0000 (10:46 -0600)]
Only run dogfood on linux in CI
bors [Wed, 12 Jan 2022 16:47:45 +0000 (16:47 +0000)]
Auto merge of #8112 - Alexendoo:disallowed_methods_primitives, r=flip1995
Allow primitive types in disallowed_methods
Fixes #8079
changelog: `disallowed_methods`: Now can disallow methods of primitive types
Alex Macleod [Thu, 9 Dec 2021 20:42:44 +0000 (20:42 +0000)]
Use method name from conf::DisallowedMethod
Since def_path_str returns e.g. "core::f32::<impl f32>::clamp" for
"f32::clamp"
bors [Wed, 12 Jan 2022 16:21:14 +0000 (16:21 +0000)]
Auto merge of #8213 - paolobarbolini:size-of-as-bits, r=flip1995
Add `manual_bits` lint
Closes #6670
---
changelog: new lint: [`manual_bits`]
Alex Macleod [Thu, 9 Dec 2021 19:11:40 +0000 (19:11 +0000)]
Resolve primitive impls in clippy_utils::path_to_res
Paolo Barbolini [Sun, 2 Jan 2022 22:34:10 +0000 (23:34 +0100)]
Add manual_bits lint
bors [Wed, 12 Jan 2022 15:11:08 +0000 (15:11 +0000)]
Auto merge of #8037 - ojeda:doc-codegen-change, r=camsteffen
`README`: document that Clippy may change codegen
Currently, Clippy does not guarantee the same codegen will be produced.
Therefore, it should not be used as an universal replacement for `rustc`.
See https://github.com/rust-lang/rust-clippy/issues/8035.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
fixes #8035
changelog: document that Clippy may change codegen
bors [Wed, 12 Jan 2022 14:25:11 +0000 (14:25 +0000)]
Auto merge of #8190 - camsteffen:no-in-band-liftetimes, r=flip1995
Stop using `in_band_lifetimes`
Per rust-lang/rust#91867
changelog: none
bors [Wed, 12 Jan 2022 13:59:12 +0000 (13:59 +0000)]
Auto merge of #8198 - camsteffen:no-method-call-macro, r=flip1995
Remove method_call! macro
This is possible now that `SymbolStr` is removed from rustc.
changelog: none
bors [Wed, 12 Jan 2022 13:25:58 +0000 (13:25 +0000)]
Auto merge of #8268 - Jarcho:deref_addrof_8247, r=flip1995
Fix `deref_addrof`
fixes #8247
This would supersede #8259
changelog: Don't lint `deref_addrof` when the dereference and the borrow occur in different contexts
Jason Newcomb [Wed, 12 Jan 2022 05:25:42 +0000 (00:25 -0500)]
Don't lint `deref_addrof` when the two operations occur in different expansions
bors [Tue, 11 Jan 2022 17:07:50 +0000 (17:07 +0000)]
Auto merge of #8262 - 1nF0rmed:chore-update-borrowed-box-doc, r=camsteffen
Improve documentation for `borrowed-box` lint
fixes #8161
Updates documentation to elaborate more on how removing Box from a function parameter can generalize the function.
changelog: none
Pradyumna Rahul [Mon, 10 Jan 2022 16:14:10 +0000 (21:44 +0530)]
Improve documentation for `borrowed-box` lint
Cameron Steffen [Tue, 11 Jan 2022 15:52:23 +0000 (09:52 -0600)]
Stop using in_band_lifetimes
bors [Tue, 11 Jan 2022 15:45:50 +0000 (15:45 +0000)]
Auto merge of #8210 - guerinoni:master, r=Manishearth
Add borrow_as_ptr lint
Closes: #6995
- \[x] Followed [lint naming conventions][lint_naming]
- \[x] Added passing UI tests (including committed `.stderr` file)
- \[x] `cargo test` passes locally
- \[x] Executed `cargo dev update_lints`
- \[x] Added lint documentation
- \[x] Run `cargo dev fmt`
---
changelog: new lint: [`borrow_as_ptr`]
Aaron Hill [Mon, 3 Jan 2022 03:37:05 +0000 (22:37 -0500)]
Store a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`
The field is also renamed from `ident` to `name. In most cases,
we don't actually need the `Span`. A new `ident` method is added
to `VariantDef` and `FieldDef`, which constructs the full `Ident`
using `tcx.def_ident_span()`. This method is used in the cases
where we actually need an `Ident`.
This makes incremental compilation properly track changes
to the `Span`, without all of the invalidations caused by storing
a `Span` directly via an `Ident`.
Miguel Ojeda [Tue, 14 Dec 2021 17:13:14 +0000 (18:13 +0100)]
`README`: mention `clippy-driver` on usage list
Removes the "compiled from source" bit, which is confusing.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Miguel Ojeda [Sat, 27 Nov 2021 16:10:19 +0000 (17:10 +0100)]
`README`: `clippy-driver` is not a replacement for `rustc`
Currently, `clippy-driver` may run codegen, but this is an
implementation detail.
See https://github.com/rust-lang/rust-clippy/issues/8035.
Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
Federico Guerinoni [Sun, 2 Jan 2022 13:26:44 +0000 (14:26 +0100)]
Add borrow_as_ptr lint
Closes: #6995
Signed-off-by: Federico Guerinoni <guerinoni.federico@gmail.com>
Co-authored-by: Paolo Barbolini <paolo@paolo565.org>
bors [Tue, 11 Jan 2022 08:09:11 +0000 (08:09 +0000)]
Auto merge of #8260 - taiki-e:mutex_atomic, r=llogiq
Downgrade mutex_atomic to nursery
See #1516 and #4295.
There are suggestions about removing this lint from the default warned lints in both issues.
Also, [`mutex_integer`](https://rust-lang.github.io/rust-clippy/master/index.html#mutex_integer) lint that has the same problems as this lint is in `nursery` group.
changelog: Moved [`mutex_atomic`] to `nursery`
Cameron Steffen [Mon, 10 Jan 2022 23:47:56 +0000 (17:47 -0600)]
Fix dogfood
bors [Mon, 10 Jan 2022 23:51:39 +0000 (23:51 +0000)]
Auto merge of #8261 - taiki-e:disallowed, r=giraffate
Warn disallowed_methods and disallowed_types by default
Closes #7841
changelog: Moved [`disallowed_methods`] and [`disallowed_types`] to `style`
Cameron Steffen [Mon, 10 Jan 2022 20:05:38 +0000 (14:05 -0600)]
Remove rustfmt component check
This was more valuable when we used the latest nightly without
specifying the toolchain version.
Cameron Steffen [Mon, 10 Jan 2022 20:03:55 +0000 (14:03 -0600)]
Merge dogfood tests
The two dogfood tests cannot be run concurrently since they use the same
target directory.
Cameron Steffen [Mon, 10 Jan 2022 21:27:00 +0000 (15:27 -0600)]
Move workspace test
Cameron Steffen [Mon, 10 Jan 2022 19:53:02 +0000 (13:53 -0600)]
Use `rustup which rustfmt`
Cameron Steffen [Mon, 10 Jan 2022 19:20:46 +0000 (13:20 -0600)]
Refactor test utils
Cameron Steffen [Mon, 10 Jan 2022 20:30:45 +0000 (14:30 -0600)]
Fix output capturing
Cameron Steffen [Mon, 10 Jan 2022 17:05:05 +0000 (11:05 -0600)]
Run dogfood on windows
I believe this is possible as of rust-lang/rust-clippy#7631
Taiki Endo [Mon, 10 Jan 2022 17:17:14 +0000 (02:17 +0900)]
Warn disallowed_methods and disallowed_types by default
Taiki Endo [Mon, 10 Jan 2022 14:36:13 +0000 (23:36 +0900)]
Downgrade mutex_atomic to nursery
bors [Mon, 10 Jan 2022 12:34:15 +0000 (12:34 +0000)]
Auto merge of #8228 - Jarcho:iter_not_returning_iterator_8225, r=giraffate
fix `iter_not_returning_iterator`
fixes #8225
changelog: Handle type projections in `iter_not_returning_iterator`
changelog: Don't lint `iter_not_returning_iterator` in trait implementations
changelog: Lint `iter_not_returning_iterator` in trait definitions
bors [Mon, 10 Jan 2022 12:18:05 +0000 (12:18 +0000)]
Auto merge of #8257 - camsteffen:internal-features, r=giraffate
Combine internal cargo features
changelog: none
This is just simpler and I don't see any downsides.
bors [Mon, 10 Jan 2022 10:31:59 +0000 (10:31 +0000)]
Auto merge of #8252 - dswij:8229, r=xFrednet
cover trait for `trait_duplication_in_bounds`
closes #8229
changelog: [`trait_duplication_in_bounds`] covers trait functions with `Self` bounds
dswij [Mon, 10 Jan 2022 04:45:01 +0000 (12:45 +0800)]
`trait_duplication_in_bounds` Update description and add test
Cameron Steffen [Mon, 10 Jan 2022 00:22:38 +0000 (18:22 -0600)]
Combine internal features in clippy_lints