Skip to content

Lint null function pointers #1644

Closed
@oli-obk

Description

@oli-obk

rust-lang/rust#40913 showed a real world case of assuming that fn() can be null.

patterns that should be linted are

std::mem::transmute::<Anything, SomeFnPtrType>(std::ptr::null())
(fn_ptr as *mut something).is_null()

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-lintArea: New lintsL-correctnessLint: Belongs in the correctness lint groupT-middleType: Probably requires verifiying typesgood first issueThese issues are a good way to get started with Clippy

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions