Closed
Description
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:
let v: &u8 = &0;
(v as *const u8).is_null();
This would involve a renaming of the lint to useless_ptr_null_checks
or incorrect_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.