Skip to content

Do not suggest assigning_clones in Clone impl #12615

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

Merged
merged 1 commit into from
Apr 3, 2024

Conversation

Kobzol
Copy link
Contributor

@Kobzol Kobzol commented Apr 2, 2024

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 rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Apr 2, 2024
Copy link
Member

@blyxyas blyxyas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@Kobzol Kobzol force-pushed the fix-recursive-clone-from branch from 1fcd467 to 571118f Compare April 3, 2024 18:55
@Kobzol
Copy link
Contributor Author

Kobzol commented Apr 3, 2024

Done :)

@blyxyas
Copy link
Member

blyxyas commented Apr 3, 2024

@bors r+

@bors
Copy link
Contributor

bors commented Apr 3, 2024

📌 Commit 571118f has been approved by blyxyas

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Apr 3, 2024

⌛ Testing commit 571118f with merge e80ca2f...

@bors
Copy link
Contributor

bors commented Apr 3, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: blyxyas
Pushing e80ca2f to master...

1 similar comment
@bors
Copy link
Contributor

bors commented Apr 3, 2024

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: blyxyas
Pushing e80ca2f to master...

@bors bors merged commit e80ca2f into rust-lang:master Apr 3, 2024
5 checks passed
@Kobzol Kobzol deleted the fix-recursive-clone-from branch April 3, 2024 19:17
@bors
Copy link
Contributor

bors commented Apr 3, 2024

👀 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
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.

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