-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Null fn lints #10099
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Null fn lints #10099
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @llogiq (or someone else) soon. Please see the contribution instructions for more information. |
@rustbot label: +A-lint, +C-enhancement, +L-correctness |
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.
This looks good in general, I have a few suggestions regarding code style.
@llogiq I believe all code style issues have been resolved, one thing I would still like to discuss though, is whether Everything I've said in the suggestion still stands, and I just mostly wanted to mention this concern here specifically, as this is not just a code style issue, and might need to be discussed outside of a suggestion. My opinion is that, while |
6a1746f
to
42ec6b8
Compare
42ec6b8
to
691df70
Compare
Thanks for the review @llogiq! Is this now ready for merge? |
Thank you! I'm a bit wary about the correctness group for the null check lint, but that may be overcautious. We can revisit this if there are any reports of false positives or something. @bors r+ |
☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test |
Adds lints to check for code, that assumes nullable
fn()
.Lint examples:
transmute_null_to_fn
:fn_null_check
:Closes #1644
changelog: Improvement: [
transmuting_null
]: Now detectsconst
pointers to all types#10099
changelog: New lint: [
transmute_null_to_fn
]#10099
changelog: New lint: [
fn_null_check
]#10099