]> git.lizzy.rs Git - rust.git/log
rust.git
2 years agoAdd lint `transumte_undefined_repr`
Jason Newcomb [Tue, 1 Feb 2022 19:53:12 +0000 (14:53 -0500)]
Add lint `transumte_undefined_repr`

2 years agoMinor cleanup on transmute lints
Jason Newcomb [Tue, 1 Feb 2022 15:53:25 +0000 (10:53 -0500)]
Minor cleanup on transmute lints

2 years agoAuto merge of #8369 - Jarcho:ptr_arg_8366, r=flip1995
bors [Mon, 31 Jan 2022 15:17:38 +0000 (15:17 +0000)]
Auto merge of #8369 - Jarcho:ptr_arg_8366, r=flip1995

Don't lint `ptr_arg` for `&mut _` types in trait items

fixes #8366

changelog: Don't lint `ptr_arg` for `&mut _` types in trait items

2 years agoAuto merge of #8322 - jubnzv:8282-single-match, r=llogiq
bors [Sun, 30 Jan 2022 22:00:36 +0000 (22:00 +0000)]
Auto merge of #8322 - jubnzv:8282-single-match, r=llogiq

single_match: Don't lint non-exhaustive matches; support tuples

`single_match` lint:
* Don't lint exhaustive enum patterns without a wild.
  Rationale: The definition of the enum could be changed, so the user can get non-exhaustive match after applying the suggested lint (see https://github.com/rust-lang/rust-clippy/issues/8282#issuecomment-1013566068 for context).
* Lint `match` constructions with tuples (as suggested at https://github.com/rust-lang/rust-clippy/issues/8282#issuecomment-1015621148)

Closes #8282

---

changelog: [`single_match`]: Don't lint exhaustive enum patterns without a wild.
changelog: [`single_match`]: Lint `match` constructions with tuples

2 years agoDon't lint `ptr_arg` for `&mut _` types in trait items
Jason Newcomb [Sat, 29 Jan 2022 14:45:47 +0000 (09:45 -0500)]
Don't lint `ptr_arg` for `&mut _` types in trait items

2 years agoAuto merge of #8289 - jubnzv:unspecified-layout-union, r=camsteffen
bors [Sat, 29 Jan 2022 10:58:16 +0000 (10:58 +0000)]
Auto merge of #8289 - jubnzv:unspecified-layout-union, r=camsteffen

Add `default_union_representation` lint

Closes #8235

changelog: Added a new lint  [`default_union_representation`]

2 years agoAdd `default_union_representation` lint
Georgy Komarov [Sat, 15 Jan 2022 09:27:24 +0000 (12:27 +0300)]
Add `default_union_representation` lint

Closes #8235

2 years agoAuto merge of #8250 - pr2502:fix_repeat_underflow, r=giraffate
bors [Fri, 28 Jan 2022 13:31:51 +0000 (13:31 +0000)]
Auto merge of #8250 - pr2502:fix_repeat_underflow, r=giraffate

Fix underflow in `manual_split_once` lint

Hi, a friend found clippy started crashing on a suspiciously large allocation of `u64::MAX` memory on their code.

The mostly minimized repro is:
```rust
fn _f01(title: &str) -> Option<()> {
    let _ = title[1..].splitn(2, '[').next()?;
    Some(())
}
```

The underflow happens in this case on line 57 of the patch but I've changed the other substraction to saturating as well since it could potentially cause the same issue.

I'm not sure where to put a regression test, or if it's even worth for such a thing.

Aside, has it been considered before to build clippy with overflow checks enabled?

changelog: fix ICE of underflow in `manual_split_once` lint

2 years agoAuto merge of #8354 - dswij:8345, r=giraffate
bors [Fri, 28 Jan 2022 05:11:09 +0000 (05:11 +0000)]
Auto merge of #8354 - dswij:8345, r=giraffate

Update docs for `map_flatten` on `Option` case

closes #8345

changelog: [`map_flatten`] Add docs info for `Option` case

2 years agoUpdate docs for `map_flatten` on `Option`
dswij [Tue, 25 Jan 2022 08:18:32 +0000 (16:18 +0800)]
Update docs for `map_flatten` on `Option`

2 years agofix underflow in `check_manual_split_once` lint
max [Sat, 8 Jan 2022 22:10:20 +0000 (23:10 +0100)]
fix underflow in `check_manual_split_once` lint

2 years agoAuto merge of #8359 - flip1995:rustup, r=flip1995
bors [Thu, 27 Jan 2022 13:48:23 +0000 (13:48 +0000)]
Auto merge of #8359 - flip1995:rustup, r=flip1995

Rustup

r? `@ghost`

changelog: none

2 years agoBump nightly version -> 2022-01-27
flip1995 [Thu, 27 Jan 2022 13:23:42 +0000 (14:23 +0100)]
Bump nightly version -> 2022-01-27

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

2 years agoAuto merge of #8350 - dswij:8331, r=Manishearth
bors [Wed, 26 Jan 2022 19:19:28 +0000 (19:19 +0000)]
Auto merge of #8350 - dswij:8331, r=Manishearth

fix bad suggestion on `numeric_literal`

closes #8331

changelog: [`numeric_literal`]  fix suggestion not showing sign

2 years agomatches: Remove extra comment
Georgy Komarov [Wed, 26 Jan 2022 16:09:31 +0000 (19:09 +0300)]
matches: Remove extra comment

2 years agomatches: Restore `match_type` logic; add tests for these cases
Georgy Komarov [Wed, 26 Jan 2022 15:20:35 +0000 (18:20 +0300)]
matches: Restore `match_type` logic; add tests for these cases

2 years agomatches: Improve naming. NFC.
Georgy Komarov [Wed, 26 Jan 2022 15:02:32 +0000 (18:02 +0300)]
matches: Improve naming. NFC.

2 years agomatches: Clarify the behavior of exhaustive check
Georgy Komarov [Wed, 26 Jan 2022 11:46:30 +0000 (14:46 +0300)]
matches: Clarify the behavior of exhaustive check

2 years agoMerge remote-tracking branch 'origin/master' into 8282-single-match
Georgy Komarov [Wed, 26 Jan 2022 11:15:50 +0000 (14:15 +0300)]
Merge remote-tracking branch 'origin/master' into 8282-single-match

2 years agofix bad suggestion on `numeric_literal`
Dharma Saputra Wijaya [Tue, 25 Jan 2022 14:19:19 +0000 (22:19 +0800)]
fix bad suggestion on `numeric_literal`

2 years agoAuto merge of #93095 - Aaron1011:remove-assoc-ident, r=cjgillot
bors [Tue, 25 Jan 2022 18:53:45 +0000 (18:53 +0000)]
Auto merge of #93095 - Aaron1011:remove-assoc-ident, r=cjgillot

Store a `Symbol` instead of an `Ident` in `AssocItem`

This is the same idea as #92533, but for `AssocItem` instead
of `VariantDef`/`FieldDef`.

With this change, we no longer have any uses of
`#[stable_hasher(project(...))]`

2 years agoAuto merge of #8343 - robjtede:patch-1, r=giraffate
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

2 years agoAutofocus search input
Rob Ede [Mon, 24 Jan 2022 11:36:15 +0000 (11:36 +0000)]
Autofocus search input

2 years agoAuto merge of #8315 - dswij:8306, r=giraffate
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

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 agoUpdate clippy
Vadim Petrochenkov [Sat, 4 Dec 2021 15:09:15 +0000 (23:09 +0800)]
Update clippy

2 years agorustc_lint: Reuse the set of registered tools from resolver
Vadim Petrochenkov [Tue, 28 Sep 2021 22:17:54 +0000 (01:17 +0300)]
rustc_lint: Reuse the set of registered tools from resolver

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 agoRemove a span from hir::ExprKind::MethodCall
Cameron Steffen [Wed, 1 Dec 2021 17:17:50 +0000 (11:17 -0600)]
Remove a span from hir::ExprKind::MethodCall

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 #91359 - dtolnay:args, r=Mark-Simulacrum
bors [Fri, 21 Jan 2022 06:20:18 +0000 (06:20 +0000)]
Auto merge of #91359 - dtolnay:args, r=Mark-Simulacrum

Emit simpler code from format_args

I made this PR so that `cargo expand` dumps a less overwhelming amount of formatting-related code.

<br>

`println!("rust")` **Before:**

```rust
{
    ::std::io::_print(::core::fmt::Arguments::new_v1(&["rust\n"],
                                                     &match () {
                                                          _args => [],
                                                      }));
};
```

**After:**

```rust
{ ::std::io::_print(::core::fmt::Arguments::new_v1(&["rust\n"], &[])); };
```

`println!("{}", x)` **Before:**

```rust
{
    ::std::io::_print(::core::fmt::Arguments::new_v1(
        &["", "\n"],
        &match (&x,) {
            _args => [::core::fmt::ArgumentV1::new(
                _args.0,
                ::core::fmt::Display::fmt,
            )],
        },
    ));
};
```

**After:**

```rust
{
    ::std::io::_print(::core::fmt::Arguments::new_v1(
        &["", "\n"],
        &[::core::fmt::ArgumentV1::new(&x, ::core::fmt::Display::fmt)],
    ));
};
```

2 years agomatches: Simplify code
Georgy Komarov [Fri, 21 Jan 2022 04:28:40 +0000 (07:28 +0300)]
matches: Simplify code

2 years ago single_match: Clarify the `don't lint` test case
Georgy Komarov [Fri, 21 Jan 2022 04:24:07 +0000 (07:24 +0300)]
 single_match: Clarify the `don't lint` test case

2 years agosingle_match: Don't lint non-exhaustive matches; support tuples
Georgy Komarov [Thu, 20 Jan 2022 11:50:14 +0000 (14:50 +0300)]
single_match: Don't lint non-exhaustive matches; support tuples

This commit changes the behavior of `single_match` lint.

After that, we won't lint non-exhaustive matches like this:

```rust
match Some(v) {
    Some(a) => println!("${:?}", a),
    None => {},
}
```

The rationale is that, because the type of `a` could be changed, so the
user can get non-exhaustive match after applying the suggested lint (see
https://github.com/rust-lang/rust-clippy/issues/8282#issuecomment-1013566068
for context).

We also will lint `match` constructions with tuples. When we see the
tuples on the both arms, we will check them both at the same time, and
if they form exhaustive match, we could display the warning.

Closes #8282

2 years ago`trait_duplication_in_bounds` checks path segments for trait items
dswij [Thu, 20 Jan 2022 05:38:48 +0000 (13:38 +0800)]
`trait_duplication_in_bounds` checks path segments for trait items

2 years agoStore a `Symbol` instead of an `Ident` in `AssocItem`
Aaron Hill [Thu, 13 Jan 2022 02:15:51 +0000 (21:15 -0500)]
Store a `Symbol` instead of an `Ident` in `AssocItem`

This is the same idea as #92533, but for `AssocItem` instead
of `VariantDef`/`FieldDef`.

With this change, we no longer have any uses of
`#[stable_hasher(project(...))]`

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 #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