-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Added from_over_into lint #6476
Conversation
r? @llogiq (rust-highfive has picked a reviewer for you, use r? to override) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only one nit and one suggestion for improvement. If you change the message, I'd be OK with merging and improving the span later.
span_lint_and_help( | ||
cx, | ||
FROM_OVER_INTO, | ||
item.span, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That item might be quite large. We may want to reduce the span to the impl
header.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How exactly would I extract the impl header? Didn't find a proper span while looking through documentation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's OK, we can do this as a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oke. If it's fine with you I could work on this, I might just need a hint on extracting the imp header Span.
Does this require a MSRV setting? The
|
That's a good point, I've missed that! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot that we want items/types marked up as code in error messages. Once that is taken care of, I'll have this merged. Thank you!
a7299c4
to
7e641c8
Compare
Co-authored-by: Takayuki Nakata <f.seasons017@gmail.com>
Thanks everyone! @bors r+ |
📌 Commit 0d6c128 has been approved by |
Added from_over_into lint Closes #6456 Added a lint that searches for implementations of `Into<..>` and suggests to implement `From<..>` instead, as it comes with a default implementation of `Into`. Category: style.
💔 Test failed - checks-action_test |
We need to update |
@bors r+ |
📌 Commit 53f4d43 has been approved by |
Added from_over_into lint Closes #6456 Added a lint that searches for implementations of `Into<..>` and suggests to implement `From<..>` instead, as it comes with a default implementation of `Into`. Category: style.
💔 Test failed - checks-action_test |
Oh, a test seems to fail due to lack of |
Ahh I forgot to add the comment. I edited my PR opening comment, is that enough to make bors happy? |
Let's see. @bors r+ |
💡 This pull request was already approved, no need to approve it again.
|
📌 Commit 53f4d43 has been approved by |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
…Manishearth Reduce the span in `from_over_into` to impl header A follow up of #6476 (comment) > That item might be quite large. We may want to reduce the span to the `impl` header. changelog: none
Closes #6456
Added a lint that searches for implementations of
Into<..>
and suggests to implementFrom<..>
instead, as it comes with a default implementation ofInto
. Category: style.changelog: added
from_over_into
lint