]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAuto merge of #8311 - dswij:8277, r=llogiq
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

2 years agofix `needless_question_mark` not considering async fn
dswij [Tue, 18 Jan 2022 10:41:00 +0000 (18:41 +0800)]
fix `needless_question_mark` not considering async fn

2 years agoAuto merge of #8217 - Jarcho:needless_borrow_8191, r=camsteffen
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`

2 years agoSubsume `ref_in_deref` into `needless_borrow`
Jason Newcomb [Wed, 12 Jan 2022 00:44:33 +0000 (19:44 -0500)]
Subsume `ref_in_deref` into `needless_borrow`

2 years agoRemove final reference on fields and method calls in `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`

2 years agoAuto merge of #8278 - Alexendoo:needless-lifetime-explicit-self-ty, r=xFrednet
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

2 years ago`needless_lifetimes`: ignore lifetimes in explicit self types
Alex Macleod [Fri, 14 Jan 2022 14:24:25 +0000 (14:24 +0000)]
`needless_lifetimes`: ignore lifetimes in explicit self types

2 years agoAuto merge of #8332 - Jarcho:clear_test_results, r=camsteffen
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

2 years agoDon't bless outdated files on windows
Jason Newcomb [Sat, 22 Jan 2022 04:11:32 +0000 (23:11 -0500)]
Don't bless outdated files on windows

2 years agoAuto merge of #8271 - Jarcho:ptr_arg_214, r=flip1995
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`

2 years agoFix `needless_borrow` causing mutable borrows to be moved
Jason Newcomb [Mon, 3 Jan 2022 17:44:33 +0000 (12:44 -0500)]
Fix `needless_borrow` causing mutable borrows to be moved

2 years ago`ptr_arg` cleanup
Jason Newcomb [Fri, 21 Jan 2022 14:43:41 +0000 (09:43 -0500)]
`ptr_arg` cleanup

2 years agoAuto merge of #8329 - Alexendoo:enum-variant-names, r=giraffate
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

2 years agoDon't suggest an empty variant name in `enum_variant_names`
Alex Macleod [Fri, 21 Jan 2022 12:40:33 +0000 (12:40 +0000)]
Don't suggest an empty variant name in `enum_variant_names`

2 years agoAuto merge of #8280 - xFrednet:8276-map-clone-msrv, r=flip1995
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

2 years agoAuto merge of #8304 - camsteffen:test-tweaks, r=flip1995
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.

2 years agoAuto merge of #8310 - camelid:rm-stringification, r=Manishearth
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

2 years agoRemove unnecessary `Symbol` stringification
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.

2 years agoAuto merge of #8298 - ebobrow:op_ref_fp, r=giraffate
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

2 years agoRemove __CLIPPY_INTERNAL_TESTS env var
Cameron Steffen [Wed, 12 Jan 2022 19:27:51 +0000 (13:27 -0600)]
Remove __CLIPPY_INTERNAL_TESTS env var

2 years agoAuto merge of #8292 - marekdownar:8239, r=xFrednet
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

2 years agoAuto merge of #8302 - xFrednet:0000-move-return-self-not-must-use, r=flip1995
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

2 years agoMove `return_self_not_must_use` to `pedantic`
xFrednet [Mon, 17 Jan 2022 11:25:38 +0000 (12:25 +0100)]
Move `return_self_not_must_use` to `pedantic`

2 years agoremoving unsafe from test fn's && renaming shrink to sugg_span
Marek Downar [Mon, 17 Jan 2022 11:34:03 +0000 (12:34 +0100)]
removing unsafe from test fn's && renaming shrink to sugg_span

2 years agoAuto merge of #8299 - marekdownar:8214, r=Manishearth
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

2 years agoAuto merge of #8297 - Jarcho:if_same_then_else_7579, r=Manishearth
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

2 years agoDon'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

2 years agoAuto merge of #8203 - pmnoxx:piotr-next-lint, r=llogiq
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`]

2 years ago#8214 cmp_owned suggestion flips the comparison
Marek Downar [Sun, 16 Jan 2022 19:27:00 +0000 (20:27 +0100)]
#8214 cmp_owned suggestion flips the comparison

2 years agoFix tests
Piotr Mikulski [Sun, 16 Jan 2022 18:32:45 +0000 (10:32 -0800)]
Fix tests

2 years agoFix clippy warnings
Piotr Mikulski [Sun, 16 Jan 2022 18:19:48 +0000 (10:19 -0800)]
Fix clippy warnings

2 years agoNew line: cloned_next
Piotr Mikulski [Fri, 31 Dec 2021 06:39:53 +0000 (22:39 -0800)]
New line: cloned_next

2 years agofix op_ref false positive
Elliot Bobrow [Sun, 16 Jan 2022 17:17:22 +0000 (09:17 -0800)]
fix op_ref false positive

2 years agoAuto merge of #8295 - Jarcho:useless_format_8290, r=giraffate
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`

2 years agoAuto merge of #8284 - xFrednet:0000-update-copyright-year-i-am-procrastinating, r...
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

2 years agoAuto merge of #8274 - andrewarchi:master, r=camsteffen
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

2 years agoHandle implicit named arguments in `useless_format`
Jason Newcomb [Sat, 15 Jan 2022 19:33:43 +0000 (14:33 -0500)]
Handle implicit named arguments in `useless_format`

2 years agoissue #8239: fix to prev commit && 4 test cases
Marek Downar [Sat, 15 Jan 2022 21:19:01 +0000 (22:19 +0100)]
issue #8239: fix to prev commit && 4 test cases

2 years agoissue #8239: Printed hint for lint or_fun_call is cropped and does not show the solution
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

2 years agoAuto merge of #8287 - Jarcho:iter_not_returning_iterator_8285, r=Manishearth
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

2 years agoErase late bound regions in `iter_not_returning_iterator`
Jason Newcomb [Sat, 15 Jan 2022 05:15:25 +0000 (00:15 -0500)]
Erase late bound regions in `iter_not_returning_iterator`

2 years agoUpdate copyright year for Clippy (2022 edition)
xFrednet [Sat, 15 Jan 2022 00:16:00 +0000 (01:16 +0100)]
Update copyright year for Clippy (2022 edition)

2 years agoTrack `msrv` attribute for `manual_bits` and `borrow_as_prt`
xFrednet [Fri, 14 Jan 2022 23:39:06 +0000 (00:39 +0100)]
Track `msrv` attribute for `manual_bits` and `borrow_as_prt`

2 years agoAdd `msrv` config for `map_clone`
xFrednet [Fri, 14 Jan 2022 22:45:05 +0000 (23:45 +0100)]
Add `msrv` config for `map_clone`

2 years agoAuto merge of #8231 - Jarcho:implicit_clone_8227, r=camsteffen
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`

2 years agoUpdate markdown-it version
Andrew Archibald [Fri, 14 Jan 2022 03:01:56 +0000 (20:01 -0700)]
Update markdown-it version

2 years agoEscape pipes in Markdown tables
Andrew Archibald [Thu, 13 Jan 2022 20:20:30 +0000 (13:20 -0700)]
Escape pipes in Markdown tables

2 years agoAuto merge of #8273 - SeeSpring:apply_not_unsafe_ptr_arg_deref_to_type_aliases, r...
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

2 years agoApply `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

2 years agoAuto merge of #8272 - flip1995:rustup, r=flip1995
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

2 years agoBump nightly version -> 2022-01-13
flip1995 [Thu, 13 Jan 2022 11:48:17 +0000 (12:48 +0100)]
Bump nightly version -> 2022-01-13

2 years agoBump Clippy Version -> 0.1.60
flip1995 [Thu, 13 Jan 2022 11:48:08 +0000 (12:48 +0100)]
Bump Clippy Version -> 0.1.60

2 years agoMerge remote-tracking branch 'upstream/master' into rustup
flip1995 [Thu, 13 Jan 2022 11:11:21 +0000 (12:11 +0100)]
Merge remote-tracking branch 'upstream/master' into rustup

2 years agoChanges to `ptr_arg`
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

2 years agoAuto merge of #8226 - Jarcho:manual_memcpy_8160, r=flip1995
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

2 years agoSuggest deref when needed in `implicit_clone`
Jason Newcomb [Wed, 5 Jan 2022 23:27:10 +0000 (18:27 -0500)]
Suggest deref when needed in `implicit_clone`

2 years agoAdd `manual_memcpy_test` for `VecDeque`
Jason Newcomb [Wed, 12 Jan 2022 17:33:47 +0000 (12:33 -0500)]
Add `manual_memcpy_test` for `VecDeque`

2 years agoAuto merge of #8266 - camsteffen:test-tweaks, r=flip1995
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.

2 years agoAuto merge of #8265 - camsteffen:which-rustfmt, r=xFrednet
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.

2 years agoOnly run dogfood on linux in CI
Cameron Steffen [Wed, 12 Jan 2022 16:46:05 +0000 (10:46 -0600)]
Only run dogfood on linux in CI

2 years agoAuto merge of #8112 - Alexendoo:disallowed_methods_primitives, r=flip1995
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

2 years agoUse method name from conf::DisallowedMethod
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"

2 years agoAuto merge of #8213 - paolobarbolini:size-of-as-bits, r=flip1995
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`]

2 years agoResolve primitive impls in clippy_utils::path_to_res
Alex Macleod [Thu, 9 Dec 2021 19:11:40 +0000 (19:11 +0000)]
Resolve primitive impls in clippy_utils::path_to_res

2 years agoAdd manual_bits lint
Paolo Barbolini [Sun, 2 Jan 2022 22:34:10 +0000 (23:34 +0100)]
Add manual_bits lint

2 years agoAuto merge of #8037 - ojeda:doc-codegen-change, r=camsteffen
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

2 years agoAuto merge of #8190 - camsteffen:no-in-band-liftetimes, r=flip1995
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

2 years agoAuto merge of #8198 - camsteffen:no-method-call-macro, r=flip1995
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

2 years agoAuto merge of #8268 - Jarcho:deref_addrof_8247, r=flip1995
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

2 years agoDon't lint `deref_addrof` when the two operations occur in different expansions
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

2 years agoAuto merge of #8262 - 1nF0rmed:chore-update-borrowed-box-doc, r=camsteffen
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

2 years agoImprove documentation for `borrowed-box` lint
Pradyumna Rahul [Mon, 10 Jan 2022 16:14:10 +0000 (21:44 +0530)]
Improve documentation for `borrowed-box` lint

2 years agoStop using in_band_lifetimes
Cameron Steffen [Tue, 11 Jan 2022 15:52:23 +0000 (09:52 -0600)]
Stop using in_band_lifetimes

2 years agoAuto merge of #8210 - guerinoni:master, r=Manishearth
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`]

2 years agoStore a `Symbol` instead of an `Ident` in `VariantDef`/`FieldDef`
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`.

2 years ago`README`: mention `clippy-driver` on usage list
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>
2 years ago`README`: `clippy-driver` is not a replacement for `rustc`
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>
2 years agoAdd borrow_as_ptr lint
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>
2 years agoAuto merge of #8260 - taiki-e:mutex_atomic, r=llogiq
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`

2 years agoFix dogfood
Cameron Steffen [Mon, 10 Jan 2022 23:47:56 +0000 (17:47 -0600)]
Fix dogfood

2 years agoAuto merge of #8261 - taiki-e:disallowed, r=giraffate
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`

2 years agoRemove rustfmt component check
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.

2 years agoMerge dogfood tests
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.

2 years agoMove workspace test
Cameron Steffen [Mon, 10 Jan 2022 21:27:00 +0000 (15:27 -0600)]
Move workspace test

2 years agoUse `rustup which rustfmt`
Cameron Steffen [Mon, 10 Jan 2022 19:53:02 +0000 (13:53 -0600)]
Use `rustup which rustfmt`

2 years agoRefactor test utils
Cameron Steffen [Mon, 10 Jan 2022 19:20:46 +0000 (13:20 -0600)]
Refactor test utils

2 years agoFix output capturing
Cameron Steffen [Mon, 10 Jan 2022 20:30:45 +0000 (14:30 -0600)]
Fix output capturing

2 years agoRun dogfood on windows
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

2 years agoWarn disallowed_methods and disallowed_types by default
Taiki Endo [Mon, 10 Jan 2022 17:17:14 +0000 (02:17 +0900)]
Warn disallowed_methods and disallowed_types by default

2 years agoDowngrade mutex_atomic to nursery
Taiki Endo [Mon, 10 Jan 2022 14:36:13 +0000 (23:36 +0900)]
Downgrade mutex_atomic to nursery

2 years agoAuto merge of #8228 - Jarcho:iter_not_returning_iterator_8225, r=giraffate
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

2 years agoAuto merge of #8257 - camsteffen:internal-features, r=giraffate
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.

2 years agoAuto merge of #8252 - dswij:8229, r=xFrednet
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

2 years ago`trait_duplication_in_bounds` Update description and add test
dswij [Mon, 10 Jan 2022 04:45:01 +0000 (12:45 +0800)]
`trait_duplication_in_bounds` Update description and add test

2 years agoCombine internal features in clippy_lints
Cameron Steffen [Mon, 10 Jan 2022 00:22:38 +0000 (18:22 -0600)]
Combine internal features in clippy_lints

2 years agoCombine internal features in clippy_utils
Cameron Steffen [Mon, 10 Jan 2022 00:16:05 +0000 (18:16 -0600)]
Combine internal features in clippy_utils

2 years agoAuto merge of #8236 - PatchMixolydic:single_char_lifetime_names, r=llogiq
bors [Sun, 9 Jan 2022 14:27:36 +0000 (14:27 +0000)]
Auto merge of #8236 - PatchMixolydic:single_char_lifetime_names, r=llogiq

new lint: `single_char_lifetime_names`

This pull request adds a lint against single character lifetime names, as they might not divulge enough information about the purpose of the lifetime. This can make code harder to understand. I placed this in `restriction` rather than `pedantic` (as suggested in #8233) since most of the Rust ecosystem already uses single character lifetime names (to my knowledge, at least) and since single character lifetime names aren't incorrect. I'd be happy to change this upon request, however. Fixes #8233.

- [x] Followed lint naming conventions
- [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: [`single_char_lifetime_names`]

2 years agonew lint: `single_char_lifetime_names`
bors [Sun, 9 Jan 2022 14:27:36 +0000 (14:27 +0000)]
new lint: `single_char_lifetime_names`

This pull request adds a lint against single character lifetime names, as they might not divulge enough information about the purpose of the lifetime. This can make code harder to understand. I placed this in `restriction` rather than `pedantic` (as suggested in #8233) since most of the Rust ecosystem already uses single character lifetime names (to my knowledge, at least) and since single character lifetime names aren't incorrect. I'd be happy to change this upon request, however. Fixes #8233.

- [x] Followed lint naming conventions
- [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: [`single_char_lifetime_names`]

2 years agocover trait for `trait_duplication_in_bounds`
dswij [Thu, 6 Jan 2022 10:43:44 +0000 (18:43 +0800)]
cover trait for `trait_duplication_in_bounds`

2 years agorustc_metadata: Rename `item_children(_untracked)` to `module_children(_untracked)`
Vadim Petrochenkov [Thu, 23 Dec 2021 08:12:34 +0000 (16:12 +0800)]
rustc_metadata: Rename `item_children(_untracked)` to `module_children(_untracked)`

And `each_child_of_item` to `for_each_module_child`