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.
- Observed
Operation π - 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
unsafeoperations underdir, 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_codeappears 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
.rsfile underdir, 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
unsafekind 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 theexpectspelling of it, at any depth.