Module dangling

Module dangling 

Source

Structsยง

DanglingPointerLocalContext ๐Ÿ”’
DanglingPointerReturnSearcher ๐Ÿ”’
DanglingPointerSearcher ๐Ÿ”’
This produces a dangling pointer:
DanglingPointers ๐Ÿ”’
FIXME: false negatives (i.e. the lint is not emitted when it should be)

Staticsยง

DANGLING_POINTERS_FROM_LOCALS
The dangling_pointers_from_locals lint detects getting a pointer to data of a local that will be dropped at the end of the function.
DANGLING_POINTERS_FROM_TEMPORARIES
The dangling_pointers_from_temporaries lint detects getting a pointer to data of a temporary that will immediately get dropped.

Functionsยง

is_temporary_rvalue ๐Ÿ”’
lint_addr_of_local ๐Ÿ”’
Look for &<path_to_local_in_same_body> pattern and emit lint for it
lint_expr ๐Ÿ”’
owns_allocation ๐Ÿ”’