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ยง
- Function
Target ๐ - Collected verification data for a single function under analysis.
- Prepare
Targets ๐ - Analysis pass that finds all verification targets.
- Struct
Target ๐ - Collected verification data for a struct that owns methods marked with
#[rapx::verify]. - Trait
Ensurance ๐ - Collected verification data for an
impl unsafe Trait for Typeblock. - Verify
Target ๐Collector - Visitor that collects targets annotated with
#[rapx::verify].
Enumsยง
- Marker
Trait ๐Kind - Which marker trait an
unsafe implis claiming safety for. - Trait
Ensurance ๐Kind - What a
TraitEnsurancemust verify.
Functionsยง
- bind_
alive_ ๐regions - Bind
Alive(p, 'a)region idents in a contract toRegions, resolving'aagainstdef_id(the item that declares'a: the struct for its invariants, the function for itsrequires). - build_
marker_ ๐trait_ obligations - Generate the type-level
ensuresobligations for a marker-trait impl from the bundledstd-trait-ensures.jsontemplate, substitutingty:Selfwith 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.jsonentry, substitutingty:Selfwithself_ty. Supports theanydisjunction 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/Moveassignment chains. ReturnsNonefor 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 aTamedRawPtrcompoundโsPtrparameter. - get_
contract_ ๐from_ annotation - Parses
requirescontracts 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 implis implementing theSend/Syncmarker 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โsValidPtr(self, T, 1)) to the wrapper calleeโs arguments (e.g.maybe_init_slotโsptr). - 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
requirescontracts. - Struct
Invariants ๐ - A list of parsed struct invariants.