-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Extend useless_ptr_null_checks to more functions #114442
Copy link
Copy link
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-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
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-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Filing an issue as #113657 has been merged and we now warn on a bunch of functions/casts that return raw pointers that will never be null. The standard library contains a larger set than the specified one though, as pointed out in this comment on the PR.
I think it would be good idea to add a
#[rustc_return_non_null_ptr]attribute, and add it to the functions mentioned in the comment, then make theuseless_ptr_null_checkslint check for that attribute.cc @Urgau