Skip to main content

Module unsafe_inventory

Module unsafe_inventory 

Expand description

The unsafe inventory: every hand-written unsafe operation under MIRROR_SRC, found by parsing the sources and held to OPERATIONS.

StructsΒ§

Counts πŸ”’
The hand-written operations found in the source tree, plus the blanket overrides and local safety comments.
ObservedOperation πŸ”’
One operation observed in the parsed source tree.
Scan πŸ”’
The syn walk that fills a Counts.

FunctionsΒ§

blanket_failures πŸ”’
block_identity πŸ”’
Stable identity for the body of an unsafe block. The expression tree keeps the operation’s semantic shape while discarding formatting and spans.
compare_operation_counts πŸ”’
compare_operation_identities πŸ”’
compare_operations πŸ”’
Compares the tree against OPERATIONS, returning a failure per surprise.
compare_safety_comments πŸ”’
expression_identity πŸ”’
generic_argument_identity πŸ”’
impl_identity πŸ”’
Stable identity for an unsafe impl, retaining both sides of the promise.
inventory πŸ”’
Finds the hand-written unsafe operations under dir, and reports an inner #![allow(unsafe_code)] as an operation of its own so it cannot pass by being merely uncounted. Each AST operation is paired, in source order, with one local // SAFETY: comment block.
names_unsafe_code πŸ”’
Whether unsafe_code appears anywhere in a token stream.
normalize_text πŸ”’
Whitespace is presentation, not part of a safety rationale’s identity.
operation_drift πŸ”’
The failure for a changed or missing operation identity or rationale.
path_arguments_identity πŸ”’
path_identity πŸ”’
Stable identity for a path, including the type/lifetime arguments that are meaningful to the four recorded operations.
recorded_operations πŸ”’
relaxes_unsafe_code πŸ”’
Whether an attribute loosens unsafe_code.
safety_comments πŸ”’
Collects contiguous // SAFETY: comment blocks in source order.
sources πŸ”’
Every .rs file under dir, in a stable order.
statement_identity πŸ”’
type_identity πŸ”’
unexpected_operation πŸ”’
The failure for an operation in a file/kind group with no recorded twin.
unsafe_drift πŸ”’
The failure for a file whose count of one unsafe kind is not the recorded one, quoting the record so a reviewer sees what was supposed to be there.
wraps_a_relaxation πŸ”’
Whether a token stream contains allow(… unsafe_code …) or the expect spelling of it, at any depth.