Skip to main content

Module target

Module target 

Source
Expand description

Discovery of verification targets and their contract obligations.

VerifyTargetCollector walks the crateโ€™s HIR (in targeted or scan mode), and for each candidate assembles a FunctionTarget: unsafe call-site checkpoints with per-callee preconditions, raw-pointer/static-mut synthetic checkpoints, struct invariants, and std type invariants.

Structsยง

FunctionTarget ๐Ÿ”’
Collected verification data for a single function under analysis.
PrepareTargets ๐Ÿ”’
Analysis pass that finds all verification targets.
StructTarget ๐Ÿ”’
Collected verification data for a struct that owns methods marked with #[rapx::verify].
TraitEnsurance ๐Ÿ”’
Collected verification data for an impl unsafe Trait for Type block.
VerifyTargetCollector ๐Ÿ”’
Visitor that collects targets annotated with #[rapx::verify].

Enumsยง

MarkerTraitKind ๐Ÿ”’
Which marker trait an unsafe impl is claiming safety for.
TraitEnsuranceKind ๐Ÿ”’
What a TraitEnsurance must verify.

Functionsยง

bind_alive_regions ๐Ÿ”’
Bind Alive(p, 'a) region idents in a contract to Regions, resolving 'a against def_id (the item that declares 'a: the struct for its invariants, the function for its requires).
build_marker_trait_obligations ๐Ÿ”’
Generate the type-level ensures obligations for a marker-trait impl from the bundled std-trait-ensures.json template, substituting ty:Self with the implementing type.
build_raw_ptr_deref_checks ๐Ÿ”’
Build (pseudo-checkpoint, properties) pairs for every raw pointer dereference in the target function.
build_static_mut_checks ๐Ÿ”’
Build (pseudo-checkpoint, properties) pairs for every static mut access in the target function.
build_type_atom ๐Ÿ”’
Build a single type-level obligation from a std-trait-ensures.json entry, substituting ty:Self with self_ty. Supports the any disjunction and falls back to named compound properties (expand_compound) for tags that are not built-in primitives.
call_arg_to_outer_param ๐Ÿ”’
Trace a call-site argument operand back to the enclosing calleeโ€™s parameter index (0-based), following direct Copy/Move assignment chains. Returns None for constants, field projections, call results, or values that do not trace to a parameter (those references cannot be restated on the enclosing callee).
collect_properties_from_named_attrs ๐Ÿ”’
extract_tamed_field ๐Ÿ”’
The raw-pointer field name a struct declares via #[rapx::invariant(Allocated(field))] or #[rapx::invariant(Owning(field))], used to bind a TamedRawPtr compoundโ€™s Ptr parameter.
get_contract_from_annotation ๐Ÿ”’
Parses requires contracts from source-level RAPx annotations attached to a definition.
get_struct_invariants_from_annotation ๐Ÿ”’
Parses struct invariants from source-level RAPx annotations attached to a struct definition.
get_trait_contracts_from_annotation ๐Ÿ”’
Parses trait safety contracts from #[rapx::ensures(...)] on unsafe trait methods, grouped by method name.
get_trait_method_requires ๐Ÿ”’
is_drop_impl ๐Ÿ”’
is_rapx_named_attr ๐Ÿ”’
marker_trait_kind ๐Ÿ”’
Resolve whether an unsafe impl is implementing the Send/Sync marker trait.
rebind_expr ๐Ÿ”’
rebind_place ๐Ÿ”’
rebind_property_arg ๐Ÿ”’
rebind_property_to_args ๐Ÿ”’
Rewrite a contractโ€™s argument references (PlaceBase::Arg(i)) onto the enclosing calleeโ€™s parameters using the call-site argument list. This rebinds a leaf calleeโ€™s contract (e.g. ptr::writeโ€™s ValidPtr(self, T, 1)) to the wrapper calleeโ€™s arguments (e.g. maybe_init_slotโ€™s ptr).
rebind_ty ๐Ÿ”’
Replace a leaf calleeโ€™s type parameter (TyKind::Param) with the concrete type argument passed at the call site.
resolve_chain_contracts ๐Ÿ”’
Follow an unsafe calleeโ€™s call chain to find inherited safety contracts.

Type Aliasesยง

FnContracts ๐Ÿ”’
A list of parsed requires contracts.
StructInvariants ๐Ÿ”’
A list of parsed struct invariants.