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

Merged
merged 82 commits into from
Jan 10, 2025
Merged

Clippy subtree update #135297

merged 82 commits into from
Jan 10, 2025

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented Jan 9, 2025

alex-semenyuk and others added 30 commits December 17, 2024 14:16
`is_integer_const()` does the const folding.
Handle field attributes in suggestions

Fix adjacent code

Address review comments

rust-lang/rust-clippy#13737 (comment)

Address all review comments but one

This comment is not yet addressed: rust-lang/rust-clippy#13737 (comment)

`initializer_suggestions` -> `lint_inconsistent_struct_field_initializers`
`is_integer_const()` does the const folding.

changelog: none
fix rust-lang#13843

The `manual_div_ceil` lint makes incorrect suggestion when type suffixes
need to be made explicit in the suggested code.

changelog: [`manual_div_ceil`]: suggested code now includes appropriate
type suffixes where necessary
…lready been resolved (rust-lang#13873)

The "known problems" pointed out in the `match_same_arms` lint seem to
have already been resolved.

changelog: none
…uirement configurable (rust-lang#13737)

Fixes rust-lang#11846.

This PR has three commits:
- The first commit adds an `initializer-suggestions` configuration to
control suggestion applicability when initializers are present. The
following are the options:
  - "none": do not suggest
- "maybe-incorrect": suggest, but do not apply suggestions with `--fix`
  - "machine-applicable": suggest and apply suggestions with `--fix`
- The second commit fixes suggestions to handle field attributes
(problem [noticed by
@samueltardieu](rust-lang/rust-clippy#13737 (comment))).
- The third commit adds `initializer-suggestions = "machine-applicable"`
to Clippy's `clippy.toml` and applies the suggestions. (Nothing seems to
break.)

---

changelog: make `inconsistent_struct_constructor` "all fields are
shorthand" requirement configurable
Convert the ICE reported in rust-lang#12979 into a false negative.
We prefer a false negative to a ICE (because the ICE could
still affect the user even when not activating the lint).
Close rust-lang#13837

changelog: [`trailing_empty_array`]: do not trigger on tests
Examples fixes for regex

changelog: none
…ang#13863)

Fixes rust-lang#13862

`missing_headers::check` is sometimes called from outside of a body
(specifically, from `check_attributes`, where the LateContext's ParamEnv
is not yet properly initialized for that item). Using that empty
ParamEnv for trait solving things from within the body can then lead to
various ICEs, like the linked issue where we have a const generic
parameter `DMA_INST` without a `ConstArgHasType` bound in the ParamEnv
so the const parameter has no type, which is normally not supposed to
happen.

We have the item's DefId so we can just get its ParamEnv/TypingEnv from
there, and using that one for trait solving should be safe.

changelog: none
Also, simplify boolean expression, and ensure that proper applicability
is used.
This PR just makes sure that we exit the function before getting an ICE
and adds a regression test. Related to rust-lang#12979. We would need to keep
researching the issue, but as the ICEing code isn't that complicated,
getting a hotfix into nightly is urgent.

changelog:[`borrow_interior_mutable_const`] Fix ICE rust-lang#12979
…t-lang#13884)

Also, simplify boolean shortcut expression, and ensure that
applicability is properly applied, as it was ignored and
`MachineApplicable` was always used.

changelog: [`borrow_as_ptr`]: do not remove required parentheses in
autofix suggestion

Close rust-lang#13882
Removing `.map(identity)` may result in invalid code if the receiver of
`map()` is an immutable binding, and the result of `map()` is used as
the receiver of a method call expecting a mutable reference.
Using `lifetime.ident.name` in suggestions will not output the raw
modifier. For example, `'r#struct` will be rendered as `'struct` which
would be incorrect.
I discovered that there were paths declared in `clippy_utils::paths` in
rust-lang/rust-clippy#13829 so moving a few
remaining hardcoded ones in one place.

changelog: Move more def paths into `clippy_utils::paths`

r? @y21
…ust-lang#13906)

Proper parentheses need to be added to some expressions in receiver
position.

Fix rust-lang#13902

changelog: [`redundant_pattern_matching`]: use proper parentheses when
suggesting replacing `matches!(…, None)` by `.is_none()`
Using `lifetime.ident.name` in suggestions will not output the raw
modifier. For example, `'r#struct` will be rendered as `'struct` which
would be incorrect.

Fix rust-lang#13899

changelog: [`needless_arbitrary_self_type`]: use the raw lifetime name
in suggestions
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jan 9, 2025
@rustbot
Copy link
Collaborator

rustbot commented Jan 9, 2025

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.

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@flip1995
Copy link
Member Author

flip1995 commented Jan 9, 2025

Cargo.lock update is for bumping the Clippy version.

@matthiaskrgr
Copy link
Member

@bors r+ p=5

@bors
Copy link
Contributor

bors commented Jan 9, 2025

📌 Commit 43c3b30 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 Jan 9, 2025
@bors
Copy link
Contributor

bors commented Jan 9, 2025

⌛ Testing commit 43c3b30 with merge af01afb...

bors added a commit to rust-lang-ci/rust that referenced this pull request Jan 9, 2025
…tthiaskrgr

Clippy subtree update

r? `@Manishearth`
@rust-log-analyzer
Copy link
Collaborator

The job x86_64-rust-for-linux failed! Check out the build log: (web) (plain)

Click to see the possible cause of the failure (guessed by this bot)
curl: (22) The requested URL returned error: 404
curl: (22) The requested URL returned error: 404
ERROR: failed to download llvm from ci

    HELP: There could be two reasons behind this:
        1) The host triple is not supported for `download-ci-llvm`.
        2) Old builds get deleted after a certain time.
    HELP: In either case, disable `download-ci-llvm` in your config.toml:
    [llvm]
    download-ci-llvm = false
    
Build completed unsuccessfully in 0:00:23

@bors
Copy link
Contributor

bors commented Jan 9, 2025

💔 Test failed - checks-actions

@bors bors added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. labels Jan 9, 2025
@matthiaskrgr
Copy link
Member

@bors retry

@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 Jan 9, 2025
@tgross35
Copy link
Contributor

I guess bors doesn't respond to treeclosed on closed PRs so stealing this one

@bors treeclosed-

@bors
Copy link
Contributor

bors commented Jan 10, 2025

⌛ Testing commit 43c3b30 with merge 88ab2d8...

@bors
Copy link
Contributor

bors commented Jan 10, 2025

☀️ Test successful - checks-actions
Approved by: matthiaskrgr
Pushing 88ab2d8 to master...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Jan 10, 2025
@bors bors merged commit 88ab2d8 into rust-lang:master Jan 10, 2025
7 checks passed
@rustbot rustbot added this to the 1.86.0 milestone Jan 10, 2025
@rust-timer
Copy link
Collaborator

Finished benchmarking commit (88ab2d8): comparison URL.

Overall result: ✅ improvements - no action needed

@rustbot label: -perf-regression

Instruction count

This is the most reliable metric that we have; it was used to determine the overall result at the top of this comment. However, even this metric can sometimes exhibit noise.

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

Max RSS (memory usage)

Results (secondary -0.4%)

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)
3.0% [3.0%, 3.0%] 1
Improvements ✅
(primary)
- - 0
Improvements ✅
(secondary)
-3.9% [-3.9%, -3.9%] 1
All ❌✅ (primary) - - 0

Cycles

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

Binary size

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

Bootstrap: 763.867s -> 762.519s (-0.18%)
Artifact size: 325.73 MiB -> 325.74 MiB (0.00%)

@flip1995 flip1995 deleted the clippy-subtree-update branch January 10, 2025 09:16
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.