Skip to content

[beta] Clippy beta backport #140810

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

Closed
wants to merge 42 commits into from
Closed

Conversation

flip1995
Copy link
Member

@flip1995 flip1995 commented May 8, 2025

Backports:

The first 2 PRs are 2 small fixes. Those alone would probably not warrant a backport, but we would rather fix those sooner than later.

The main backport is the last PR, with the prior PR introducing more improvements on top. This fixes rust-lang/rust-clippy#14525, an issue that got introduced by a too eager lint that was added in beta 1.87. This would be annoying for Clippy users, if this would hit stable.

r? @Mark-Simulacrum

BoxyUwU and others added 30 commits March 31, 2025 18:07
[beta] Prepare Rust 1.87.0

r? ghost
…nglo

[beta-1.87] Update cargo

1 commits in a6c604d1b8a2f2a8ff1f3ba6092f9fda42f4b7e9..202515849e943032d8fdd3eba57bf2c86e0da736
2025-03-26 18:11:00 +0000 to 2025-04-06 19:30:58 -0400
- [beta-1.87] chore: Bump cargo-util-schemas to 0.8.1 (rust-lang/cargo#15402)

r? ghost
[beta] Revert "Remove `prev_index_to_index` field from `CurrentDepGraph`"

This reverts rust-lang#138824 on beta to fix issues with incremental compilation in that PR. rust-lang#139410 will fix these on master.

r? `@oli-obk`
(cherry picked from commit f9927ee)
This reverts commit 6adc2c1.

(cherry picked from commit 38f7060)
Signed-off-by: Petros Angelatos <[email protected]>
(cherry picked from commit 9eb6a54)
This PR is fixing a regression introduced by rust-lang#121646 that can lead to a
double free when dropping the channel.

The details of the bug can be found in the corresponding crossbeam PR
crossbeam-rs/crossbeam#1187

Signed-off-by: Petros Angelatos <[email protected]>
(cherry picked from commit b9e2ac5)
[beta] backports

- Fix 2024 edition doctest panic output rust-lang#139328
- make `Arguments::as_statically_known_str` doc(hidden) rust-lang#139389
- Revert "Deduplicate template parameter creation" rust-lang#139878
- sync::mpsc: prevent double free on `Drop` rust-lang#139553

r? cuviper
…g param-env for receiver_is_dispatchable

(cherry picked from commit 4f2baaa)
This commit fixes a false positive of the warning triggered for rust-lang#138762
and the fix is to codify that zero-sized types are "safe" in both the
old and new ABIs.

(cherry picked from commit f9091e2)
This has other warnings if necessary and doesn't need extra warnings
from this FCW.

cc rust-lang#138762

(cherry picked from commit 19e44d4)
Beta-backporting rust-lang#140228 has the same effect on this test as rust-lang#139341
already had on master.
[beta] backports

- Do not mix normalized and unnormalized caller bounds when constructing param-env for `receiver_is_dispatchable` rust-lang#138941
- Ignore zero-sized types in wasm future-compat warning rust-lang#139498
- Don't warn about `v128` in wasm ABI transition rust-lang#139809
- Revert overzealous parse recovery for single colons in paths rust-lang#140228

r? cuviper
[beta] Delay `hash_extract_if` stabilization from 1.87 to 1.88

This PR is a revert of:

- rust-lang#134655

for use in the event that we are unable to get rust-lang#139764 into 1.87 (current beta).
fmease and others added 9 commits May 2, 2025 09:35
[beta] backports

- Don't allow flattened format_args in const. rust-lang#139624
- set subsections_via_symbols for ld64 helper sections rust-lang#139752
- Fix detection of `main` function if there are expressions around it rust-lang#140220
- rustdoc: Fix doctest heuristic for main fn wrapping rust-lang#140420
- extend the list of registered dylibs on `test::prepare_cargo_test` rust-lang#140563

r? cuviper
…nglo

[beta-1.87] Update cargo

1 commits in 202515849e943032d8fdd3eba57bf2c86e0da736..99624be96e9d213b0e9b1e36451271f24e4a41d8
2025-04-06 19:30:58 -0400 to 2025-05-06 19:28:33 -0500
- [beta-1.87] fix(rustc): Don't panic on unknown bins (rust-lang/cargo#15500)
…st-lang#14568)

Fixes rust-lang/rust-clippy#14449, introduced in rust-lang#14314

changelog: [`map_entry`]: fix a false positive where the lint would
trigger without any insert calls present
We do not want to remove casts done inside macros. Also, when printing
the suggestion, take it from the same context as the origin expression
(the root context).

Problems found while working on rust-lang#14526, but should be merged even if
rust-lang#14526 is not.

changelog: none
`ptr_eq` was recently enhanced to lint on more cases of raw pointers
comparison:

- lint on all raw pointer comparison, by proposing to use
`[core|std]::ptr::eq(lhs, rhs)` instead of `lhs == rhs`;
- removing one symetric `as usize` on each size if needed
- peeling any level of `as *[const|mut] _` if the remaining expression
can still be coerced into the original one (i.e., is a ref or raw
pointer to the same type as before)

The current change restricts the lint to the cases where at least one
level of symetric `as usize`, or any conversion to a raw pointer, could
be removed. For example, a direct comparaison of two raw pointers will
not trigger the lint anymore.

changelog: [`ptr_eq`]: do not lint when comparing two raw pointers
directly with no casts involved

Fixes rust-lang/rust-clippy#14525
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 8, 2025
@rustbot
Copy link
Collaborator

rustbot commented May 8, 2025

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@bors
Copy link
Collaborator

bors commented May 9, 2025

☔ The latest upstream changes (presumably #140838) made this pull request unmergeable. Please resolve the merge conflicts.

@pietroalbini
Copy link
Member

I'll directly include this in the stable PR (doing it earlier than usual this cycle). The next beta just branched: will this need to be backported in 1.88 beta too?

@flip1995
Copy link
Member Author

flip1995 commented May 9, 2025

will this need to be backported in 1.88 beta too?

No, all those commits were already on master before 1.88 beta branched.

@pietroalbini
Copy link
Member

Ok, folded this into #140859

bors added a commit to rust-lang-ci/rust that referenced this pull request May 9, 2025
[stable] Prepare the 1.87.0 release

Preparing the stable artifacts as described in the release process.

This PR also includes the following last minute backports:

* rust-lang#140810
* rust-lang#140601
* rust-lang#140684

r? `@ghost`
@flip1995 flip1995 deleted the clippy-beta-backport branch May 9, 2025 16:37
bors added a commit to rust-lang-ci/rust that referenced this pull request May 9, 2025
[stable] Prepare the 1.87.0 release

Preparing the stable artifacts as described in the release process.

This PR also includes the following last minute backports:

* rust-lang#140810
* rust-lang#140601
* rust-lang#140684

r? `@ghost`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging this pull request may close these issues.