Skip to main content

Module place

Module place 

Source
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 Field projection of place on adt_def_id (e.g. ptr in self.ptr), if any.
index_access_locals πŸ”’
Extract the bound slice and index locals from an InBound property.
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_place only handles a bare return (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 syn expression. 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 SliceOffset property.
strip_for_each πŸ”’
Strip a ForEach projection from a property argument.
walk_fields πŸ”’
Walk field names, retaining their indices and the final type.

Type AliasesΒ§

PlacePath πŸ”’