]> git.lizzy.rs Git - rust.git/log
rust.git
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 #87648 - JulianKnodt:const_eq_constrain, r=oli-obk
bors [Tue, 18 Jan 2022 09:58:39 +0000 (09:58 +0000)]
Auto merge of #87648 - JulianKnodt:const_eq_constrain, r=oli-obk

allow eq constraints on associated constants

Updates #70256

(cc `@varkor,` `@Centril)`

2 years agoAuto merge of #93001 - flip1995:clippyup, r=Manishearth
bors [Tue, 18 Jan 2022 02:32:36 +0000 (02:32 +0000)]
Auto merge of #93001 - flip1995:clippyup, r=Manishearth

Out of cycle Clippy update

I want to do an out-of-cycle sync for rust-lang/rust-clippy#8295, and possibly backport this to stable together with https://github.com/rust-lang/rust/issues/92938. If this doesn't get backported to stable, then I at least want to backport it to beta.

r? `@Manishearth`

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 agoUpdate w/ comments
kadmin [Tue, 11 Jan 2022 19:18:18 +0000 (19:18 +0000)]
Update w/ comments

Removes uses of ty() where a method is implemented on TypeFoldable, and also directly formats
a Term.

2 years agoUpdate term for use in more places
kadmin [Mon, 10 Jan 2022 23:39:21 +0000 (23:39 +0000)]
Update term for use in more places

Replace use of `ty()` on term and use it in more places. This will allow more flexibility in the
future, but slightly worried it allows items which are consts which only accept types.

2 years agoBless clippy ui tests after format_args change
David Tolnay [Mon, 17 Jan 2022 19:04:41 +0000 (11:04 -0800)]
Bless clippy ui tests after format_args change

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 agoUse Term in ProjectionPredicate
kadmin [Sat, 8 Jan 2022 09:28:12 +0000 (09:28 +0000)]
Use Term in ProjectionPredicate

ProjectionPredicate should be able to handle both associated types and consts so this adds the
first step of that. It mainly just pipes types all the way down, not entirely sure how to handle
consts, but hopefully that'll come with time.

2 years agoAdd term
kadmin [Fri, 7 Jan 2022 03:58:32 +0000 (03:58 +0000)]
Add term

Instead of having a separate enum variant for types and consts have one but have either a const
or type.

2 years agoadd eq constraints on associated constants
kadmin [Fri, 30 Jul 2021 08:56:45 +0000 (08:56 +0000)]
add eq constraints on associated constants

2 years agoAuto merge of #90986 - camsteffen:nested-filter, r=cjgillot
bors [Mon, 17 Jan 2022 14:50:50 +0000 (14:50 +0000)]
Auto merge of #90986 - camsteffen:nested-filter, r=cjgillot

Replace `NestedVisitorMap` with generic `NestedFilter`

This is an attempt to make the `intravisit::Visitor` API simpler and "more const" with regard to nested visiting.

With this change, `intravisit::Visitor` does not visit nested things by default, unless you specify `type NestedFilter = nested_filter::OnlyBodies` (or `All`). `nested_visit_map` returns `Self::Map` instead of `NestedVisitorMap<Self::Map>`. It panics by default (unreachable if `type NestedFilter` is omitted).

One somewhat trixty thing here is that `nested_filter::{OnlyBodies, All}` live in `rustc_middle` so that they may have `type Map = map::Map` and so that `impl Visitor`s never need to specify `type Map` - it has a default of `Self::NestedFilter::Map`.

2 years agoMerge commit '8d14c94b5c0a66241b4244f1c60ac5859cec1d97' into clippyup
flip1995 [Mon, 17 Jan 2022 12:29:07 +0000 (13:29 +0100)]
Merge commit '8d14c94b5c0a66241b4244f1c60ac5859cec1d97' into clippyup

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 #92816 - tmiasko:rm-llvm-asm, r=Amanieu
bors [Mon, 17 Jan 2022 09:40:29 +0000 (09:40 +0000)]
Auto merge of #92816 - tmiasko:rm-llvm-asm, r=Amanieu

Remove deprecated LLVM-style inline assembly

The `llvm_asm!` was deprecated back in #87590 1.56.0, with intention to remove
it once `asm!` was stabilized, which already happened in #91728 1.59.0. Now it
is time to remove `llvm_asm!` to avoid continued maintenance cost.

Closes #70173.
Closes #92794.
Closes #87612.
Closes #82065.

cc `@rust-lang/wg-inline-asm`

r? `@Amanieu`

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 agoFix Visitor::NestedFilter in Clippy
Cameron Steffen [Sat, 15 Jan 2022 22:07:52 +0000 (16:07 -0600)]
Fix Visitor::NestedFilter in Clippy

2 years agoFormat clippy
Cameron Steffen [Sun, 16 Jan 2022 21:58:54 +0000 (15:58 -0600)]
Format clippy

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 #92805 - BoxyUwU:revert-lazy-anon-const-substs, r=lcnr
bors [Sun, 16 Jan 2022 11:19:21 +0000 (11:19 +0000)]
Auto merge of #92805 - BoxyUwU:revert-lazy-anon-const-substs, r=lcnr

partially revertish `lazily "compute" anon const default substs`

reverts #87280 except for some of the changes around `ty::Unevaluated` having a visitor and a generic for promoted
why revert: <https://github.com/rust-lang/rust/pull/92805#issuecomment-1010736049>

r? `@lcnr`

2 years agoAuto merge of #92740 - cuviper:update-rayons, r=Mark-Simulacrum
bors [Sun, 16 Jan 2022 08:12:23 +0000 (08:12 +0000)]
Auto merge of #92740 - cuviper:update-rayons, r=Mark-Simulacrum

Update rayon and rustc-rayon

This updates rayon for various tools and rustc-rayon for the compiler's parallel mode.

- rayon v1.3.1 -> v1.5.1
- rayon-core v1.7.1 -> v1.9.1
- rustc-rayon v0.3.1 -> v0.3.2
- rustc-rayon-core v0.3.1 -> v0.3.2

... and indirectly, this updates all of crossbeam-* to their latest versions.

Fixes #92677 by removing crossbeam-queue, but there's still a lingering question about how tidy discovers "runtime" dependencies. None of this is truly in the standard library's dependency tree at all.

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 agoReturn a LocalDefId in get_parent_item.
Camille GILLOT [Thu, 21 Oct 2021 17:41:47 +0000 (19:41 +0200)]
Return a LocalDefId in get_parent_item.

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 agonyahggdshjjghsdfhgsf
Ellen [Thu, 13 Jan 2022 09:26:27 +0000 (09:26 +0000)]
nyahggdshjjghsdfhgsf

2 years agoinitial revert
Ellen [Wed, 12 Jan 2022 03:19:52 +0000 (03:19 +0000)]
initial revert

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 agoRollup merge of #92849 - flip1995:clippyup, r=Manishearth
Matthias Krüger [Fri, 14 Jan 2022 06:47:37 +0000 (07:47 +0100)]
Rollup merge of #92849 - flip1995:clippyup, r=Manishearth

Clippyup

r? ```@Manishearth```

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 agoAuto merge of #89861 - nbdd0121:closure, r=wesleywiser
bors [Thu, 13 Jan 2022 18:51:07 +0000 (18:51 +0000)]
Auto merge of #89861 - nbdd0121:closure, r=wesleywiser

Closure capture cleanup & refactor

Follow up of #89648

Each commit is self-contained and the rationale/changes are documented in the commit message, so it's advisable to review commit by commit.

The code is significantly cleaner (at least IMO), but that could have some perf implication, so I'd suggest a perf run.

r? `@wesleywiser`
cc `@arora-aman`

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 agoFix Clippy sync fallout
flip1995 [Thu, 13 Jan 2022 12:37:24 +0000 (13:37 +0100)]
Fix Clippy sync fallout

2 years agoMerge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup
flip1995 [Thu, 13 Jan 2022 12:18:19 +0000 (13:18 +0100)]
Merge commit '97a5daa65908e59744e2bc625b14849352231c75' into clippyup

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 agoRemove LLVM-style inline assembly from clippy
Tomasz Miąsko [Wed, 12 Jan 2022 00:00:00 +0000 (00:00 +0000)]
Remove LLVM-style inline assembly from clippy

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 agoUpdate rayon and rustc-rayon
Josh Stone [Mon, 10 Jan 2022 19:34:07 +0000 (11:34 -0800)]
Update rayon and rustc-rayon

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