-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.T-langRelevant to the language teamRelevant to the language team
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.
Metadata
Metadata
Assignees
Labels
A-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.Area: Lints (warnings about flaws in source code) such as unused_mut.T-langRelevant to the language teamRelevant to the language team