Expand description
Contract annotations on functions and structs.
Re-exportsΒ§
use crate::contract::Property;πuse crate::contract::PropertyArg;πuse crate::contract::PropertyKind;πuse crate::contract::attr::collect_properties_from_named_attrs;πuse crate::contract::attr::is_rapx_named_attr;πuse crate::contract::attr::parse_rapx_attr;πuse crate::contract::is_static_lifetime_ident;πuse crate::util::fn_info::get_adt_def_id_by_adt_method;πuse crate::util::mir_utils::has_rapx_attr;πuse rustc_hir::ItemKind;πuse rustc_hir::def_id::DefId;πuse rustc_middle::ty;πuse rustc_middle::ty::EarlyParamRegion;πuse rustc_middle::ty::GenericParamDefKind;πuse rustc_middle::ty::Region;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_span::Symbol;π
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). - function_
has_ πrapx_ struct_ invariant - Check whether a functionβs owning struct declares a RAPx invariant.
- 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_ πmethod_ requires - has_
rapx_ πstruct_ invariant - Check whether a local struct declares a RAPx invariant without parsing it.
- owning_
field_ πpaths_ from_ annotation - Resolve
Owning(self.field...)invariants on a local returned struct to field-index paths, without requiring a methodselfbinding. - resolve_
region_ πname - Resolve a lifetime name from a contract (e.g.
"a","static_lifetime") to a concreteRegion.nameis the raw ident, without the leading'.