Expand description
Centralized contract query service.
Provides a unified API for querying safety contracts from all sources:
- Inline
#[rapx::requires(...)]annotations — highest priority, parsed from HIR attributes. #[rapx::ensures(...)]on trait methods — inherited by implementors that lack their own annotations.- Bundled JSON contracts — embedded backup for standard-library unsafe APIs without inline annotations.
- Chain resolution — follows the call chain to find inherited contracts.
Contract resolution priority (per VerifyTargetCollector::get_fn_contracts):
a. Inline #[rapx::requires] on the callee.
b. Trait method #[rapx::requires] (if the callee is a trait impl without its
own annotations).
c. Bundled JSON contracts (for std callees).
d. Recursive chain resolution (resolve_chain_contracts) — follows the call
chain to find inherited contracts.
Functions§
- any_
entry_ 🔒to_ property - Parse an
anydisjunction entry from JSON into aProperty::Orproperty. - entry_
to_ property - Convert a single
PropertyEntryfrom JSON into the properties it denotes. - is_
contract_ 🔒token_ char - normalize_
json_ contract_ arg - Convert explicit JSON contract tokens into the expression syntax accepted by the existing property parser.
- query_
json_ contracts - Query contracts for a function from the bundled JSON backup database.
- resolve_
json_ args - Resolve JSON contract argument strings to parsed
syn::Exprvalues. - resolve_
json_ param_ name - Resolve a simple parameter-name reference in a JSON contract arg string to
the
arg:Npositional form. Complex expressions (containing function calls, field access, etc.) are left unchanged — they are handled later by the expression parser which already knows how to resolve named parameters. - scan_
while 🔒