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

[beta] Clippy backport #124369

Merged
merged 5 commits into from
Apr 27, 2024
Merged

[beta] Clippy backport #124369

merged 5 commits into from
Apr 27, 2024

Conversation

flip1995
Copy link
Member

r? @Mark-Simulacrum

Backports:

The first one is a bit bigger as usual for a backport. But it fixes a major issue with this lint that we overlooked. So I think this is worth it. After that was merged into nightly, there were no new issues opened about this lint, so IMO this is safe to backport to beta and put into stable.

@rustbot
Copy link
Collaborator

rustbot commented Apr 25, 2024

⚠️ Warning ⚠️

  • Pull requests are usually filed against the master branch for this repo, but this one is against beta. Please double check that you specified the right target!

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Apr 25, 2024
@rustbot
Copy link
Collaborator

rustbot commented Apr 25, 2024

Some changes occurred in src/tools/clippy

cc @rust-lang/clippy

@y21
Copy link
Member

y21 commented Apr 25, 2024

Do we also need to backport 5d66521 ? I think without that one we'll run into #123465 (comment) again

bors and others added 5 commits April 25, 2024 16:29
don't lint [`mixed_attributes_style`] when mixing docs and other attrs

fixes: rust-lang#12435
fixes: rust-lang#12436
fixes: rust-lang#12530

---

changelog: don't lint [`mixed_attributes_style`] when mixing different kind of attrs; and move it to late pass;
…logiq

Move `mixed_attributes_style` to style

> It currently is in suspicious. I wouldn't say that the linted code is "most likely wrong or useless"
[...]
> 😅 I would still argue that this doesn't belong in the suspicious group, but rather in the style group.

These are some good points made [on zulip](https://rust-lang.zulipchat.com/#narrow/stream/257328-clippy/topic/mixed_attributes_style.20on.20outlined.20modules/near/429823328).

----

changelog: Move [`mixed_attributes_style`] to the `style` category
Fix infinite loop in `cast_sign_loss` when peeling unwrap method calls

Fixes rust-lang#12506

The lint wants to peel method calls but didn't actually reassign the expression, leading to an infinite loop.

----

changelog: Fix infinite loop in [`cast_sign_loss`] when having two chained `.unwrap()` calls
avoid an ICE in `ptr_as_ptr` when getting the def_id of a local

Fixes rust-lang#12616

`Res::def_id` can panic, so avoid calling it in favor of `opt_def_id`, so we can gracefully handle resolutions that don't have a `DefId` (e.g. local variables) and get a false negative in the worst case, rather than an ICE

changelog: Fix ICE in [`ptr_as_ptr`] when the cast expression is a function call to a local variable
@flip1995
Copy link
Member Author

Done. Let's hope CI passes now.

@Mark-Simulacrum
Copy link
Member

@bors r+ rollup=never p=1

@bors
Copy link
Contributor

bors commented Apr 27, 2024

📌 Commit 199c298 has been approved by Mark-Simulacrum

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 Apr 27, 2024
@bors
Copy link
Contributor

bors commented Apr 27, 2024

⌛ Testing commit 199c298 with merge b7e3de2...

@bors
Copy link
Contributor

bors commented Apr 27, 2024

☀️ Test successful - checks-actions
Approved by: Mark-Simulacrum
Pushing b7e3de2 to beta...

@bors bors added the merged-by-bors This PR was explicitly merged by bors. label Apr 27, 2024
@bors bors merged commit b7e3de2 into rust-lang:beta Apr 27, 2024
12 checks passed
@rustbot rustbot added this to the 1.78.0 milestone Apr 27, 2024
@flip1995 flip1995 deleted the clippy-backport branch April 28, 2024 19:46
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. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants