Module ptr_nulls

Source

Structsยง

PtrNullChecks

Staticsยง

INVALID_NULL_ARGUMENTS ๐Ÿ”’
The invalid_null_arguments lint checks for invalid usage of null pointers in arguments.
USELESS_PTR_NULL_CHECKS ๐Ÿ”’
The useless_ptr_null_checks lint checks for useless null checks against pointers obtained from non-null types.

Functionsยง

is_null_ptr ๐Ÿ”’
Checks if the given expression is a null pointer (modulo casting)
useless_check ๐Ÿ”’
This function checks if the expression is from a series of consecutive casts, ie. (my_fn as *const _ as *mut _).cast_mut() and whether the original expression is either a fn ptr, a reference, or a function call whose definition is annotated with #![rustc_never_returns_null_ptr]. If this situation is present, the function returns the appropriate diagnostic.