3

Do not suggest `assigning_clones` in `Clone` impl by Kobzol · Pull Request #1261...

 2 weeks ago
source link: https://github.com/rust-lang/rust-clippy/pull/12615
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Conversation

Contributor

This PR modifies assigning_clones to detect situations where the clone call is inside a Clone impl, and avoids suggesting the lint in such situations.

r? @blyxyas

Fixes: #12600

changelog: Do not invoke assigning_clones inside Clone impl

rustbot

added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label

Apr 2, 2024

Member

@blyxyas blyxyas

left a comment

LGTM, thanks! ❤️
Took me a bit to understand. Could you format? (because CI and all that)

Contributor

Author

Done :)

Member

@bors r+

Collaborator

📌 Commit 571118f has been approved by blyxyas

It is now in the queue for this repository.

Collaborator

⌛ Testing commit 571118f with merge e80ca2f...

1 similar comment

bors

merged commit e80ca2f into

rust-lang:master

Apr 3, 2024

5 checks passed

Kobzol

deleted the fix-recursive-clone-from branch

April 3, 2024 19:17

Collaborator

👀 Test was successful, but fast-forwarding failed: 422 Changes must be made through a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

blyxyas

blyxyas approved these changes
Assignees

blyxyas

Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

assigning_clones causes infinite recursion when it triggers inside a clone_from() impl

4 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK