Skip to content

Extend useless_ptr_null_checks to more functions #114442

Description

@est31

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 the useless_ptr_null_checks lint check for that attribute.

cc @Urgau

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintsArea: 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.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions