Expand description
Place resolution: syn::Expr β ContractPlace.
Resolve contract places against rustc types and bind them to MIR locals.
Re-exportsΒ§
use crate::util::mir_utils;πuse rustc_abi::FieldIdx;πuse rustc_hir::def::DefKind;πuse rustc_hir::def_id::DefId;πuse rustc_middle::mir::Local;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_middle::ty::TyKind;πuse syn::Expr;πuse crate::util::fn_info::FnKind;πuse crate::util::fn_info::get_type;πuse crate::util::name::access_ident_recursive;πuse crate::util::name::get_adt_self_ty;πuse crate::util::name::parse_signature;πuse super::ContractExpr;πuse super::ContractPlace;πuse super::ContractProjection;πuse super::PlaceBase;πuse super::Property;πuse super::PropertyArg;πuse super::PropertyKind;π
FunctionsΒ§
- bind_
call_ πproperty - Bind a callee property to the callerβs argument and return locals.
- field_
name_ πfrom_ arg - The field name targeted by an
Allocated/Owning-style property argument, whether it was parsed as a bare identifier or as a resolved place. - field_
name_ πfrom_ place - The field name selected by the first
Fieldprojection ofplaceonadt_def_id(e.g.ptrinself.ptr), if any. - index_
access_ πlocals - Extract the bound slice and index locals from an
InBoundproperty. - is_
array_ πfor_ each - Check if the given expression refers to a function parameter whose type is an array whose elements should be checked individually.
- map_
expr_ πplaces - map_
property_ πplaces - parse_
contract_ πplace - parse_
expr_ πinto_ local_ and_ ty - parse_
named_ πplace - parse_
return_ πfield_ place - Resolve a place rooted at the functionβs return value with field projections
(
return.0,return.pointer).parse_named_placeonly handles a barereturn(no projections); this walks the field chain against the return type. - rebind_
property_ πplace - Rebind every place in a struct invariant to a MIR local.
- resolve_
next_ πfield - resolve_
place_ πfrom_ ident - Resolve a place given its base identifier and field-name list directly,
without going through a
synexpression. Used by the pest converter. - resolve_
projection_ πfrom_ base_ ident - resolve_
projection_ πfrom_ struct_ ident - slice_
offset_ πlocals - Extract the bound result, base, and index locals from a
SliceOffsetproperty. - strip_
for_ πeach - Strip a
ForEachprojection from a property argument. - walk_
fields π - Walk field names, retaining their indices and the final type.
Type AliasesΒ§
- Place
Path π