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

For to_* variant don't lint in trait impl taking self when non-Copy type #7182

Merged
merged 1 commit into from
May 7, 2021

Conversation

mgacek8
Copy link
Contributor

@mgacek8 mgacek8 commented May 6, 2021

Lint name: wrong_self_convention.
It relaxes rules for to_* variant, so it doesn't lint in trait definitions and implementations anymore.
Although, non-Copy type implementing trait's to_* method taking
self feels not good (consumes ownership, so should be rather named into_), it would be better if this case was a pedantic lint (allow-by-default) instead.
More information in the discussion with @flip1995 here

changelog: wrong_self_convention: For to_* variant don't lint in trait impl taking self when non-Copy type
r? @flip1995

…king `self` when non-`Copy` type

It relaxes rules for `to_*` variant, so it doesn't lint in trait definitions
and implementations anymore.
Although, non-`Copy` type implementing trait's `to_*` method taking
`self` feels not good (consumes ownership, so should be rather named `into_`), it would be better if this case was a pedantic lint (allow-by-default) instead.
@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label May 6, 2021
@flip1995
Copy link
Member

flip1995 commented May 7, 2021

@bors r+

Thanks!

@bors
Copy link
Contributor

bors commented May 7, 2021

📌 Commit ab3094b has been approved by flip1995

@bors
Copy link
Contributor

bors commented May 7, 2021

⌛ Testing commit ab3094b with merge 4756667...

@bors
Copy link
Contributor

bors commented May 7, 2021

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

@bors bors merged commit 4756667 into rust-lang:master May 7, 2021
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.

4 participants