Skip to content
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

Clippy subtree update #128193

Merged
merged 141 commits into from
Jul 26, 2024
Merged

Clippy subtree update #128193

merged 141 commits into from
Jul 26, 2024

Conversation

flip1995
Copy link
Member

r? @Manishearth

Updates Cargo.lock due to the Clippy version update and the ui_test bump to v0.24

Jarcho and others added 30 commits July 5, 2024 03:02
* Check HIR beffore type checking
* Only lint when `Arc::new` is called
* Don't clone the token stream
* Check the HIR tree before reading attributes
* Check HIR tree before checking macros, msrv and constness
* Remove redundant HIR tree matching
* Merge control flow before emission
* Check the AST before the macro check
with `Option::unwrap_or(self, T) -> T`.
* Merge code paths.
* Check HIR tree before checking for macros.
* Check HIR tree before checking for macros.
* Check item count before checking for bools.
* Inline `is_empty_exported_or_macro`.
* Check if there are any generic parameters before walking the signature.
* Check HIR tree first.
* Merge lint calls.
bors and others added 14 commits July 24, 2024 00:44
… r=Manishearth

Make `BindInsteadOfMap` a struct

Makes it codegen once instead of three times

changelog: none
…nkov

Make ast `MutVisitor` have the same method name and style as `Visitor`

It doesn't map 100% because some `MutVisitor` methods can filter or even expand to multiple items, but consistency seems nicer.

tracking issue: rust-lang#127615
Use ControlFlow in more places

Now, instead of manually using variables in visitors to signify that a visit is "done" and that the visitor should stop traversing. We use the trait type "Result" to signify this (in relevant places).

I'll schedule a perf run, I don't think it will be much of a difference, but every bit of performance is welcomed :)

changelog: Improve performance, less memory use in visitors

Fixes rust-lang#12829
r? `@y21`
Lint casts to `u128` in `cast_lossless`

Reverts rust-lang#12496 per https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/Should.20.60as.20u128.60.20trigger.20cast_lossless

Also changes the lint messages and refactors the suggestion production - Fixes rust-lang#12695

changelog: [`cast_lossless`]: lint casts to `u128`
…ut, r=Alexendoo

Lintcheck: Rework and limit diff output for GH's CI

### Background

While working on rust-lang/rust-clippy#13136 I found an amazing limitation of GH's CI. The summary can at most have be 1MB of text. Here is the warning message:

> $GITHUB_STEP_SUMMARY upload aborted, supports content up to a size of 1024k, got 46731k. For more information see: https://docs.github.com/actions/using-workflows/workflow-commands-for-github-actions#adding-a-markdown-summary

[The PR](rust-lang/rust-clippy#13136) produced a *casual* 61808 changes. Guess that's why those lints are not *warn-by-default* :P.

### Changes:

This PR limits the lintcheck diff output in two ways.

1. The diff is limited to 200 messages per lint per section. Hidden messages are indicated by a message at the end of the section.
2. The output is first written to a file and only the first 1MB is written to ` >> $GITHUB_STEP_SUMMARY`. The entire file is also written to the normal CI log. This helps for cases where several lints change and the total size exceeds the 1MB limit.

An example of these changes can be seen here: https://github.com/xFrednet/rust-clippy/actions/runs/10028799118?pr=4

---

changelog: none

r? `@Alexendoo`

Sorry for bombarding you with so many PR's lately 😅 Feel free to pass some of you reviews to me.
Changelog for Clippy 1.80 🌞

Roses are red,
Violets are blue,
Summer is fun,
So much sun

---

### The cat of this release is *Maunzer* submitted by `@llogiq:`

<img height=500 src="https://github.com/rust-lang/rust-clippy/assets/4200835/a1da6948-446d-4ccf-95a7-c816a8afdc3f" alt="The cats of this Clippy release" />

Cats for the next release can be nominated in the comments :D

---

changelog: none

I wish everyone reading this a beautiful and happy day =^.^=
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 25, 2024
@rustbot
Copy link
Collaborator

rustbot commented Jul 25, 2024

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

These commits modify the Cargo.lock file. Unintentional changes to Cargo.lock can be introduced when switching branches and rebasing PRs.

If this was unintentional then you should revert the changes before this PR is merged.
Otherwise, you can ignore this comment.

@matthiaskrgr
Copy link
Member

@bors r+ p=1

@bors
Copy link
Contributor

bors commented Jul 25, 2024

📌 Commit 0949ff9 has been approved by matthiaskrgr

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 Jul 25, 2024
@bors
Copy link
Contributor

bors commented Jul 26, 2024

⌛ Testing commit 0949ff9 with merge 48bbe12...

@bors
Copy link
Contributor

bors commented Jul 26, 2024

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 48bbe12 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jul 26, 2024
@bors bors merged commit 48bbe12 into rust-lang:master Jul 26, 2024
7 checks passed
@rustbot rustbot added this to the 1.82.0 milestone Jul 26, 2024
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (48bbe12): 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)

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

Cycles

Results (secondary 2.1%)

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.

mean range count
Regressions ❌
(primary)
- - 0
Regressions ❌
(secondary)
2.1% [2.1%, 2.1%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
- - 0
All ❌✅ (primary) - - 0

Binary size

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

Bootstrap: 771s -> 772.066s (0.14%)
Artifact size: 328.99 MiB -> 328.93 MiB (-0.02%)

@beetrees
Copy link
Contributor

GitHub closed #12695 due to 5e6540f (which referenced rust-lang/rust-clippy#12695) when this PR was merged, despite it being unrelated. Could someone reopen it please?

@flip1995 flip1995 deleted the clippy-subtree-update branch July 26, 2024 13:33
flip1995 pushed a commit to flip1995/rust that referenced this pull request Aug 8, 2024
…tthiaskrgr

Clippy subtree update

r? `@Manishearth`

Updates Cargo.lock due to the Clippy version update and the ui_test bump to v0.24
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.