Skip to content

Update clippy #102106

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 62 commits into from
Sep 22, 2022
Merged

Update clippy #102106

merged 62 commits into from
Sep 22, 2022

Conversation

djkoloski
Copy link
Contributor

dswij and others added 30 commits September 1, 2022 18:46
A u128 has an 8 byte alignment on x86, but a 16 byte alignment on
aarch64 which changes the size of the enums due to extra padding
…anishearth

Replace u128 with u64 in large_enum_variant uitest

A u128 has [an 8 byte alignment on x86](rust-lang#54341), but a 16 byte alignment on aarch64 which changes the size of the enums due to extra padding. This means the test fails on aarch64

changelog: none
fix `implements_trait` and `in_external_macro` import path

Remove example using `match_trait_method` since its deprecated
[`assertions_on_result_states`]: Fix suggestion when `assert!` is not in a statement.

fix rust-lang/rust-clippy#9450

changelog: [`assertions_on_result_states`]: Fix suggestion when `assert!` is not in a statement.
Do not expand macro in `nonminimal_bool` suggestions

fix rust-lang/rust-clippy#9428

changelog: Do not expand macros in [`nonminimal_bool`] suggestions
Use macro callsite when creating `Sugg` helper

Closes rust-lang#9375

changelog: Improvement: [`collapsible_if`]: Suggestions now work with macros, by taking the call site into account.
Use `visit_expr_field` for `ParamPosition`

A small change to make it a little simpler

changelog: none
Fix FormatArgsExpn parsing of FormatSpec positions

Woops, forgot visitors don't walk themselves

Fixes rust-lang#9468

r? `@giraffate`

changelog: none
Don't lint `large_stack_array` inside static items

We now check if the linted `Expr` is inside an `ItemKind::Static`, which can't take the suggested `Box<[...]`. I _think_ this is the correct fix for rust-lang#9460

I removed `if_chain` while I was at it.

changelog: Don't lint `large_stack_array` inside static items
Don't panic on invalid shift while constfolding

Instead of panicking on invalid shifts while folding constants we simply give up. Fixes rust-lang#9463

Notice the "attempt to shift right by `1316134912_u32`", which seems weird. AFAICS it comes from rustc itself.

changelog: none
Fix dev book

fix `implements_trait` and `in_external_macro` import path

Remove example using `match_trait_method` since its deprecated.

changelog: none
Do not lint `use_self` in proc macro expansion

fix rust-lang/rust-clippy#9440
fix rust-lang/rust-clippy#8910
fix rust-lang/rust-clippy#6902

changelog: [`use_self`]: Do not lint in proc macro expansion
Make `derivable_impls` machine applicable

changelog: [`derivable_impls`]: Now machine applicable
bors and others added 15 commits September 15, 2022 09:03
…dnet

Add `iter_kv_map` lint

fixes rust-lang#9376

| before | after |
| -------------- | ------------------------- |
| `hmap.iter().map(\|(key, _)\| key)` | `hmap.keys()` |
| `hmap.iter().map(\|(_, v)\| v + 2)` | `hmap.values().map(\|v\| v + 2)` |
| `hmap.into_iter().map(\|(key, _)\| key)` | `hmap.into_keys()` |

Is `MachineApplicable`

changelog: [`iter_kv_map`]: added lint
Add `#[allow(unused)]` to test in `cargo dev new_lint`

`rustfix` tests don't automatically apply `-Aunused` which leads to some tests having `_workarounds`, add it to new test files automatically so people don't have to worry about it

changelog: none
[arithmetic-side-effects] Finish non-overflowing ops

Extends rust-lang/rust-clippy#9474 to also take into consideration "raw" binary operations. For example, `let a = b / 2` and `let a = 1 * b` won't trigger the lint.

changelog: [arithmetic-side-effects] Finish non-overflowing ops
[arithmetic-side-effects] Add more tests

Taken from the `integer-arithmetic` lint.

changelog: [arithmetic-side-effects] Add more tests
Fixes rust-lang#9504

Compiler generated call `into_iter` nodes return empty substs
which we need when checking it's predicates. Handle this by
simply exitting when we encounter one. This change introduces
false negatives in place of the ICEs.
Fix ICE in `unnecessary_to_owned`

Fixes rust-lang#9504

Compiler generated call `into_future` nodes return empty substs which we need when checking it's predicates. Handle this by simply exitting when we encounter one. This change introduces false negatives in place of the ICEs.

changelog: [`unnecessary_to_owned`]: fix ICE
Add matches! checking to nonstandard_macro_braces

changelog: Enhancement: [`nonstandard_macro_braces`]: Now includes `matches!()` in the default lint config
  [rust-lang#9471](rust-lang/rust-clippy#9471)
@rustbot
Copy link
Collaborator

rustbot commented Sep 21, 2022

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 21, 2022
@Manishearth
Copy link
Member

@bors r+ p=1

@bors
Copy link
Collaborator

bors commented Sep 21, 2022

📌 Commit 0650c40 has been approved by Manishearth

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Sep 21, 2022
@bors
Copy link
Collaborator

bors commented Sep 21, 2022

⌛ Testing commit 0650c40 with merge 4a4fd12...

@bors
Copy link
Collaborator

bors commented Sep 22, 2022

☀️ Test successful - checks-actions
Approved by: Manishearth
Pushing 4a4fd12 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Sep 22, 2022
@bors bors merged commit 4a4fd12 into rust-lang:master Sep 22, 2022
@rustbot rustbot added this to the 1.66.0 milestone Sep 22, 2022
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (4a4fd12): comparison URL.

Overall result: no relevant changes - no action needed

@rustbot label: -perf-regression

Instruction count

This benchmark run did not return any relevant results for this metric.

Max RSS (memory usage)

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.6% [2.3%, 2.9%] 2
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-2.4% [-2.7%, -2.2%] 2
All ❌✅ (primary) - - 0

Cycles

Results

This is a less reliable metric that may be of interest but was not used to determine the overall result at the top of this comment.

mean1 range count2
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
3.0% [2.9%, 3.2%] 3
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Footnotes

  1. the arithmetic mean of the percent change 2

  2. number of relevant changes 2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged-by-bors This PR was explicitly merged by bors. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.