Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Add lint inherent_associated_pub_const_missing #714
Add lint inherent_associated_pub_const_missing #714
Changes from 3 commits
d1ba5a7
37702f4
9ba6760
0c677cc
79adc6d
6ff5d23
bd81dc1
99b523d
3995496
8042812
938db7d
ea1f008
f11a39f
76b2b57
90c3172
49eb155
4cf6944
4081a40
c4062cf
11c7098
afb330a
60b2ed3
353d8a8
c42b06c
7da4ce5
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
Oooh interesting, this is a false-positive — we wanted this to not get flagged.
Perhaps because the
N
constant isn't defined in theimpl
block and is instead a default item on the trait? 🤔Sorry this is turning into a bit of a rabbit hole. I see two options to move forward here.
If this PR isn't something you find that interesting and you don't want to go down the rabbit hole (which is totally fine!), we can merge it as-is and I can open a separate issue for resolving this false-positive.
If you find this PR interesting and you'd like to continue polishing it, then it would be great to do the following:
const
doesn't have a default value and is instead given a value in theimpl
block for the trait.Your call! Let me know how you'd prefer to move forward.
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 think I would keep working on it but if you think this is a rare case and it would be more beneficial to have the lint as it is currently than to not have it at all you can merge it. I don't have a problem either way.
BTW, I added the test case, it didn't trigger the lint.
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.
Nice! There's no rush to merge this if you are happy to keep working on it. I was just offering it in case you felt frustrated by the back-and-forth on it, or if you just wanted a change of pace to something else.
It's great that the new test case didn't trigger the lint. Let's try tweaking the lint then.
We probably want to go back to
inherent_impl
like we had before. Then we probably want to add another block that also says "no implemented trait has a const by that name either." Here's a short snippet in the playground to help you get started: linkLmk if you get stuck or would like another pair of eyes on something!