-
Notifications
You must be signed in to change notification settings - Fork 12.7k
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
Extend incorrect_fn_null_checks lint to useless_ptr_null_checks #113601
Comments
est31
added
the
A-lint
Area: Lints (warnings about flaws in source code) such as unused_mut.
label
Jul 12, 2023
rustbot
added
the
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
label
Jul 12, 2023
Noratrieb
added
T-lang
Relevant to the language team, which will review and decide on the PR/issue.
and removed
needs-triage
This issue may need triage. Remove it if it has been sufficiently triaged.
labels
Jul 12, 2023
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Aug 3, 2023
…ck-lint, r=cjgillot Expand, rename and improve `incorrect_fn_null_checks` lint This PR, - firstly, expand the lint by now linting on references - secondly, it renames the lint `incorrect_fn_null_checks` -> `useless_ptr_null_checks` - and thirdly it improves the lint by catching `ptr::from_mut`, `ptr::from_ref`, as well as `<*mut _>::cast` and `<*const _>::cast_mut` Fixes rust-lang#113601 cc `@est31`
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this issue
Aug 3, 2023
…ck-lint, r=cjgillot Expand, rename and improve `incorrect_fn_null_checks` lint This PR, - firstly, expand the lint by now linting on references - secondly, it renames the lint `incorrect_fn_null_checks` -> `useless_ptr_null_checks` - and thirdly it improves the lint by catching `ptr::from_mut`, `ptr::from_ref`, as well as `<*mut _>::cast` and `<*const _>::cast_mut` Fixes rust-lang#113601 cc ``@est31``
github-actions bot
pushed a commit
to rust-lang/miri
that referenced
this issue
Aug 4, 2023
…r=cjgillot Expand, rename and improve `incorrect_fn_null_checks` lint This PR, - firstly, expand the lint by now linting on references - secondly, it renames the lint `incorrect_fn_null_checks` -> `useless_ptr_null_checks` - and thirdly it improves the lint by catching `ptr::from_mut`, `ptr::from_ref`, as well as `<*mut _>::cast` and `<*const _>::cast_mut` Fixes rust-lang/rust#113601 cc ```@est31```
flip1995
pushed a commit
to flip1995/rust-clippy
that referenced
this issue
Aug 10, 2023
…r=cjgillot Expand, rename and improve `incorrect_fn_null_checks` lint This PR, - firstly, expand the lint by now linting on references - secondly, it renames the lint `incorrect_fn_null_checks` -> `useless_ptr_null_checks` - and thirdly it improves the lint by catching `ptr::from_mut`, `ptr::from_ref`, as well as `<*mut _>::cast` and `<*const _>::cast_mut` Fixes rust-lang/rust#113601 cc ```@est31```
thomcc
pushed a commit
to tcdi/postgrestd
that referenced
this issue
Oct 17, 2023
…r=cjgillot Expand, rename and improve `incorrect_fn_null_checks` lint This PR, - firstly, expand the lint by now linting on references - secondly, it renames the lint `incorrect_fn_null_checks` -> `useless_ptr_null_checks` - and thirdly it improves the lint by catching `ptr::from_mut`, `ptr::from_ref`, as well as `<*mut _>::cast` and `<*const _>::cast_mut` Fixes rust-lang/rust#113601 cc ```@est31```
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'd suggest extending the newly added
incorrect_fn_null_checks
lint added in #111717 to cover cases of null comparison for other non-nullable types, like for instance in:This would involve a renaming of the lint to
useless_ptr_null_checks
orincorrect_ptr_null_checks
. I don't think having multiple lints for different kinds of non-nullable types is useful (one for function pointers, one for references, etc).See discussion starting from here.
cc @Urgau @scottmcm
The text was updated successfully, but these errors were encountered: