Skip to main content

VmExecutor

Struct VmExecutor 

Source
pub(crate) struct VmExecutor<'z3, 'tcx> {
    target_def_id: DefId,
    instantiated_target_body: Option<&'tcx Body<'tcx>>,
    pub(crate) z3_ctx: &'z3 Context,
    pub(crate) tcx: TyCtxt<'tcx>,
    constructor_mir_mode: ConstructorMirMode,
    path_state: VmState<'z3, 'tcx>,
}
Expand description

Executes MIR using an immutable context and a path-local symbolic state.

§Agent Rules

Do not add new fields without human approval.

Fields§

§target_def_id: DefId

Function being verified, retained while inlined callee frames execute.

§instantiated_target_body: Option<&'tcx Body<'tcx>>

Target MIR instantiated with a selected trait-bound implementor when an unresolved, unmodeled generic trait call needs a concrete method target. None uses the original optimized MIR, even for generic functions.

§z3_ctx: &'z3 Context

Shared Z3 context.

§tcx: TyCtxt<'tcx>

Compiler type context.

§constructor_mir_mode: ConstructorMirMode

Constructor MIR mode selected for this verification run.

§path_state: VmState<'z3, 'tcx>

Mutable state cloned when execution branches into separate paths.

Implementations§

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn resolve_origin( &self, value: &VmValue<'z3, 'tcx>, ) -> Option<VmOrigin>

Trace the origin of a pointer value through VM provenance.

Given a VmValue (extracted from a checkpoint argument), follows its provenance back to determine where the allocation came from.

Source

fn classify_local(&self, local: &Local) -> VmOriginKind

Classify a local by its type.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn eval_contract_tree( &self, expr: &ContractExpr<'tcx>, checkpoint: Option<&Checkpoint<'tcx>>, ) -> Option<Int<'z3>>

Source

pub(crate) fn instantiate_callsite_ty( &self, checkpoint: &Checkpoint<'tcx>, ty: Ty<'tcx>, ) -> Ty<'tcx>

Source

fn instantiate_callsite_const( &self, checkpoint: &Checkpoint<'tcx>, index: u32, ) -> Option<Int<'z3>>

Source

fn is_caller_type_param(&self, ty: Ty<'tcx>) -> bool

Source

fn eval_contract_method_call( &self, receiver: &ContractExpr<'tcx>, method: DefId, args: &[ContractExpr<'tcx>], checkpoint: Option<&Checkpoint<'tcx>>, ) -> Option<Int<'z3>>

Source

fn eval_contract_expr_check_leaf( &self, checkpoint: Option<&Checkpoint<'tcx>>, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>

Source

pub(crate) fn eval_contract_expr_to_value( &self, checkpoint: Option<&Checkpoint<'tcx>>, expr: &ContractExpr<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>

Source

fn eval_contract_place( &self, checkpoint: Option<&Checkpoint<'tcx>>, cp: &ContractPlace, ) -> Option<Int<'z3>>

Source

fn eval_contract_operand(&self, op: &Operand<'tcx>) -> Option<Int<'z3>>

Source

fn try_iter_len_from_fields( &self, checkpoint: &Checkpoint<'tcx>, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn callsite_contract_target_value( &self, args: &[Operand<'tcx>], property: &Property<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>

Resolve a property’s target using the checkpoint’s call arguments.

Source

fn callsite_contract_place_value( &self, args: &[Operand<'tcx>], place: &ContractPlace, ) -> Option<VmValue<'z3, 'tcx>>

Source

pub(crate) fn has_bounded_object_span( &self, alloc_id: AllocId, value: &VmValue<'z3, 'tcx>, ty: Ty<'tcx>, ) -> bool

Source

pub(crate) fn has_bounded_range( &self, alloc_id: AllocId, address: &Int<'z3>, bytes: &Int<'z3>, ) -> bool

Source

pub(crate) fn callsite_operand_for_local<'a>( &self, checkpoint: &'a Checkpoint<'tcx>, local: usize, ) -> Option<&'a Operand<'tcx>>

Source

pub(crate) fn contract_place_term_at( &self, checkpoint: &Checkpoint<'tcx>, place: &ContractPlace, ) -> Option<Int<'z3>>

Bind a contract place to a term at this checkpoint. A callee parameter local refers to its callsite operand when one is available.

Source

pub(crate) fn resolve_pointer_provenance( &self, value: VmValue<'z3, 'tcx>, ) -> VmValue<'z3, 'tcx>

Penetrate a reference/raw-pointer target down to the owned heap behind it. A target like &mut ManuallyDrop<Box<T>> or *mut Box<T> carries the stack provenance of the referent; the properties that matter (Allocated/Owning/ValidPtr) concern the heap object inside, so resolve through the referent local’s owned heap field.

Source

pub(crate) fn is_value_aligned(&self, value: &VmValue<'z3, 'tcx>) -> bool

Whether value is known to be aligned: either align_n carries a concrete alignment, or the value sits at the base of an allocation whose align is not 1.

Source

pub(crate) fn is_maybe_uninit_ptr( &self, value: &VmValue<'z3, 'tcx>, alloc_id: AllocId, ) -> bool

Whether value is a MaybeUninit-typed pointer access into alloc_id.

assume_init_drop / as_mut_ptr (and friends) legitimately consume an initialized element from storage that may be going out of scope, so the Init/Allocated requirement concerns the write, not the allocation’s live/dead flag.

Source

pub(crate) fn unsized_slice_len( &self, value: &VmValue<'z3, 'tcx>, required_ty: Option<Ty<'tcx>>, ) -> Option<Int<'z3>>

Element count of one object when the access is to an unsized [T]: the slice length from the pointer’s metadata. An unknown length stays unknown. Other objects return None.

Source

pub(crate) fn access_bytes( &self, value: &VmValue<'z3, 'tcx>, required_ty: Option<Ty<'tcx>>, count: Int<'z3>, ) -> Int<'z3>

Byte span requested by a pointer property, using the VM’s element-size model for concrete and generic pointee types.

Source

pub(crate) fn atom_depends_on_inline_terms( &self, checkpoint: &Checkpoint<'tcx>, property: &Property<'tcx>, terms: &FxHashSet<Int<'z3>>, ) -> bool

Whether this atom’s target or a checkpoint argument depends on an unconstrained value introduced by incomplete inlining.

Source

fn value_involves_terms( &self, terms: &FxHashSet<Int<'z3>>, value: &VmValue<'z3, 'tcx>, ) -> bool

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn inject_layout_constraints( &mut self, operand: &Operand<'tcx>, val: &VmValue<'z3, 'tcx>, )

Inject layout constraints (>= 1) for generic AlignOf/SizeOf constants.

Source

pub(crate) fn try_emit_gcd_divisibility( &mut self, operand: &Operand<'tcx>, val: &VmValue<'z3, 'tcx>, )

Preserve the divisibility relation of the recursive gcd const expression used by slice::align_to_offsets. CTFE leaves its result symbolic for generic element sizes.

Source

pub(crate) fn non_trivial_align(align: Int<'z3>) -> Option<Int<'z3>>

Some(align) when align is non-trivial (≠ 1); None for a byte alignment, which carries no alignment guarantee.

Source

pub(crate) fn alloc_align_of( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>

The provenance allocation’s alignment, when it is non-trivial (≠ 1).

Source

pub(crate) fn emit_div_rem_axioms( &mut self, op: BinOp, term: &Int<'z3>, lhs: &Int<'z3>, rhs: &Int<'z3>, )

Assert the Euclidean division identity and its bounds for Div/Rem: lhs == (lhs/rhs)*rhs + lhs%rhs ∧ lhs%rhs >= 0 plus (lhs/rhs)*rhs <= lhs directly for robustness. This lets later checks prove (x/N)*N <= x and x%N >= 0.

term must be the same Z3 term returned by eval_binary_op (the quotient), not a separate lhs.div(rhs) call, so the axiom constrains the term used in subsequent operations.

Source

fn bool_as_int(&self, cond: &Bool<'z3>) -> Int<'z3>

Source

fn negate(&self, val: &Int<'z3>) -> Int<'z3>

Source

pub(crate) fn eval_binary_op( &mut self, op: BinOp, lhs: &Int<'z3>, rhs: &Int<'z3>, ) -> Int<'z3>

Source

pub(crate) fn eval_unary_op( &mut self, op: UnOp, val: &Int<'z3>, is_bool: bool, ) -> Int<'z3>

Source

pub(crate) fn integer_limits( &self, ty: Ty<'tcx>, ) -> Option<(Int<'z3>, Int<'z3>, Int<'z3>, bool)>

Source

pub(crate) fn wrap_integer_term(&self, ty: Ty<'tcx>, raw: &Int<'z3>) -> Int<'z3>

Source

fn compute_pointer_add_align( &self, base: &VmValue<'z3, 'tcx>, stride_bytes: u64, ) -> Option<Int<'z3>>

Compute the preserved alignment when doing base + offset * stride. Pointer arithmetic only ever preserves the base’s alignment; it never creates it. When the base’s alignment is unknown, we cannot conclude anything about the result (a wrapping_add over misaligned storage does not become aligned just because the stride is a power of two).

Source

fn pointer_stride_term( &mut self, dest: Local, base: &VmValue<'z3, 'tcx>, stride: Option<u64>, ) -> Int<'z3>

The byte stride for a pointer add/sub: the fixed stride, or the pointee’s symbolic size when the stride is element-sized (a generic T).

Source

pub(crate) fn apply_pointer_add( &mut self, dest: Local, base: &VmValue<'z3, 'tcx>, offset: &VmValue<'z3, 'tcx>, stride: Option<u64>, dereferenceable: bool, )

Model dest = base.offset(offset) with element/byte stride and tracked provenance (offset_kind), shared by call effects and the inlined Offset MIR statement.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn assert_call_result_invariants(&mut self, destination: Local)

Source

pub(crate) fn assert_summary_result_type_invariants( &mut self, callee: DefId, destination: Local, )

Source

pub(crate) fn assert_call_postconditions( &mut self, callee: DefId, args: &[Option<Local>], destination: Local, )

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn materialize_slice_ref_return(&mut self, dest: Local)

Source

pub(crate) fn slice_len_of_alloc(&self, alloc_id: AllocId) -> Option<Int<'z3>>

The slice/array element count for an allocation: the materialized slice_len, or size / elem_size as a fallback for allocations created before materialization (e.g. some call effects). Uses the symbolic element size (size_sym_read) so len = (len·S) / S cancels to len for a generic element type — mirroring set_len_from_alloc. Returns None when the element type is unknown.

Source

pub(crate) fn slice_len_from_value( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>

The slice length of a &[T] / &mut [T] value, from pointer metadata when available or its provenance allocation otherwise.

Source

pub(crate) fn try_adt_len_field( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>

Resolve x.len() for a pointer whose pointee ADT carries a len field (e.g. NodeRef<LeafNode>: len() reads (*ptr).len). Returns the pointee’s len field term, or None when the pointee has no such field.

Source

fn try_adt_len_field_at( &self, alloc_id: AllocId, ty: Ty<'tcx>, root_ty: Ty<'tcx>, prefix: &[usize], ) -> Option<Int<'z3>>

Resolve a len field on ty, recursing into ADT sub-fields when there is no direct len (e.g. String { vec: Vec { ptr, len, cap } } resolves String.len() to vec.len). root_ty stays fixed as the allocation’s element type, which is how decompose_pointee_fields keys MemoryContent::values.

Source

pub(crate) fn try_index_range_len( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>

Resolve len() for core::ops::IndexRange (a private { start, end } struct): len() = end - start. The len field lookup above misses it because IndexRange has no len field — its len() computes the difference of its two private fields.

Source

pub(crate) fn len_from_value( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>

Resolve len() of a slice/ADT value: the pointee ADT’s len field, then the materialized slice length, then size / elem_size. Shared by the exec- and checker-side Len evaluators so the fallback chain is defined once.

Source

pub(crate) fn capacity_from_value( &self, val: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>

Source

pub(crate) fn try_struct_nn_len_field( &self, local: Local, field_path: &[usize], ty: Ty<'tcx>, ) -> Option<Int<'z3>>

Resolve x.len() for a struct x (e.g. NodeRef) whose len() method reads (*x.field).len through a NonNull/raw-pointer field. Follows that field to its pointee allocation and reads the pointee’s len field.

Source

pub(crate) fn field_type_at( &self, local: Local, field_path: &[usize], ) -> Option<Ty<'tcx>>

Resolve the type of a local plus its field-index path.

Source

pub(crate) fn find_nn_pointee(&self, ty: Ty<'tcx>) -> Option<Ty<'tcx>>

Extract the pointee type if ty is a #[repr(transparent)] single-field raw-pointer wrapper (NonNull<P>) or wrapped in Option<NonNull<P>>. Returns Some(P).

Detected structurally (via #[repr(transparent)] + a raw-pointer field) rather than by name, so re-implemented std types in the challenge suites are modelled identically to their std counterparts.

Source

fn transparent_ptr_pointee( &self, adt_def: &AdtDef<'_>, substs: GenericArgs<'tcx>, ) -> Option<Ty<'tcx>>

Pointee type of a #[repr(transparent)] single-field raw-pointer wrapper such as NonNull<T> (struct NonNull<T> { pointer: *const T }).

Source

pub(crate) fn is_transparent_newtype(&self, ty: Ty<'tcx>) -> bool

Whether ty is a #[repr(transparent)] newtype (a single non-zero-sized field whose value is that field, e.g. MaybeUninit<T>, ManuallyDrop<T>, Wrapping<T>, NonNull<T>). Construction and field reads are modelled transparently: the wrapper value is the field value itself.

Source

pub(crate) fn container_ptr_field(&self, ty: Ty<'tcx>) -> Option<Vec<usize>>

Source

fn container_ptr_field_inner( &self, ty: Ty<'tcx>, prefix: Vec<usize>, depth: usize, ) -> Option<Vec<usize>>

Source

pub(crate) fn container_data_alloc( &self, header: AllocId, ty: Ty<'tcx>, ) -> Option<AllocId>

Source

pub(crate) fn data_alloc_of( &self, header: AllocId, ty: Ty<'tcx>, ) -> Option<AllocId>

The data allocation behind a container header or a slice view’s header. Tries the type-driven owning field first, then falls back to scanning the header’s materialized fields for the first owning pointer (covers slice views whose header AllocId no longer carries a type key).

Source

fn header_data_alloc(&self, header: AllocId) -> Option<AllocId>

Scan a header allocation’s materialized fields for the owning pointer (its provenance names the data allocation). This is the header → data fallback for slice views (whose provenance names the container header, not the data), replacing the old slice_data edge.

Returns the provenance only when the header has exactly one owning pointer field. A multi-owning-pointer header (e.g. a linked list’s head/tail) is ambiguous, so fall back to None rather than guess.

Source

pub(crate) fn vec_reallocation_targets( &self, value: &VmValue<'z3, 'tcx>, ) -> Vec<(AllocId, Ty<'tcx>)>

Resolve a mutable Vec receiver, including a borrow of its backing buffer fields (as used by reserve’s MIR). A borrow of an unrelated field, such as the length, does not replace the backing allocation.

Source

pub(crate) fn reallocate_vec_backing(&mut self, value: &VmValue<'z3, 'tcx>)

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn assert_contract_fact(&mut self, property: &Property<'tcx>)

Source

fn collect_alias_hazard_allocs( &self, property: &Property<'tcx>, out: &mut FxHashSet<AllocId>, )

Source

fn place_root_alloc(&self, cp: &ContractPlace) -> Option<AllocId>

Source

fn assert_atom_direct(&mut self, property: &Property<'tcx>)

Apply a single atom’s direct effect (its match kind arm), without recursing into its subsumption consequences.

Source

pub(crate) fn record_bounded_result_span(&mut self, destination: Local)

Source

fn contract_target_local(&self, property: &Property<'tcx>) -> Option<Local>

Get the local referenced by a contract property’s target.

Source

fn assert_valid_cstr_fact(&mut self, property: &Property<'tcx>)

Source

fn mark_alloc_live_keep( &mut self, val: &VmValue<'z3, 'tcx>, elem_ty: Ty<'tcx>, ) -> bool

Materialize a fresh external allocation for an Allocated contract fact, returning a value carrying the allocation’s provenance. Mark the target pointer’s existing allocation as live (and record its element type for downstream Typed checks). Returns true when the pointer already carried an allocation, so a fresh external allocation should not be materialized (which would loosen bound checks).

Source

fn materialize_external_alloc( &mut self, elem_ty: Ty<'tcx>, count_term: Option<Int<'z3>>, val_ty: Ty<'tcx>, huge: bool, ) -> VmValue<'z3, 'tcx>

Source

fn assert_allocated_fact(&mut self, property: &Property<'tcx>)

Assert an Allocated(p, T, n) contract fact by materializing a fresh external allocation for the pointer-typed target.

  • For a whole pointer parameter (src), the allocation is sized n * sizeof(T) so downstream pointer arithmetic stays in bounds.
  • For a plain pointer field (e.g. RawVecInner::ptr), the allocation is written back to the field via set_contract_target_value and retains an unknown extent with a separately recorded covered range.
  • For Downcast targets, the legacy whole-local behaviour applies.
Source

fn materialize_allocated_fact(&mut self, property: &Property<'tcx>)

Source

fn contract_field_path( &self, property: &Property<'tcx>, ) -> Option<(Local, Vec<usize>)>

Resolve a contract place to (local, field_path). Field projections are accumulated into field_path; Downcast/ForEach terminate the path (they unwrap the value in place).

Source

fn contract_target_value( &self, property: &Property<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>

Get the VmValue for a contract property’s target, following field projections so that Align(self.heap, T) resolves to the heap field value rather than the whole self reference.

Source

fn set_contract_target_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )

Write a contract target value back to its (possibly field) location.

Source

fn contract_alloc_id_field_aware( &self, property: &Property<'tcx>, ) -> Option<AllocId>

Resolve the alloc_id for a contract property target, following field projections to locate the actual field value’s provenance.

Source

fn resolve_contract_count(&self, arg: &PropertyArg<'tcx>) -> Option<Int<'z3>>

Resolve a contract count argument to a Z3 term by looking up the corresponding function parameter in the VM state.

Source

fn eval_predicate_as_bool( &self, pred: &NumericPredicate<'tcx>, ) -> Option<Bool<'z3>>

Evaluate a numeric predicate to a Z3 Bool for path-condition assertion.

Source

fn eval_numeric_binary( &self, left: &Int<'z3>, right: &Int<'z3>, op: BinOp, ) -> Option<Int<'z3>>

Source

fn set_non_null_for_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )

Set non_null invariant on the target value.

Source

fn set_in_bounds_for_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )

Source

fn assert_in_bound_for_each( &mut self, property: &Property<'tcx>, fe_base: &PlaceBase, )

Source

fn assert_in_bound_single(&mut self, property: &Property<'tcx>)

Record the numeric index < len bound for a single-index InBound(slice, index), so a derived index (e.g. index - 1 guarded by index >= 1) can be discharged by SMT rather than only via the coarse in_bounds flag. Range indices (start..end) are left to the checker’s extract_range_end (end <= len).

Source

fn record_index_access_fact(&mut self, property: &Property<'tcx>)

Source

pub(crate) fn assert_pointee_struct_invariants( &mut self, dest_ty: Ty<'tcx>, dest_local: Local, )

When a &T/&mut T reference is created (e.g. via &*NonNull<T>), assume T’s #[rapx::invariant]s on the new reference local, rebinding the invariant’s self place to that reference. This is what lets a struct’s invariants flow through pointer dereferences into the caller’s state.

Source

pub(crate) fn assert_alloc_pointee_invariants( &mut self, alloc_id: AllocId, pointee_ty: Ty<'tcx>, )

Assert a pointee ADT’s #[rapx::invariant] struct invariants directly against its materialized per-allocation field values. This is the pointer-field analogue of [assert_pointee_struct_invariants](Self:: assert_pointee_struct_invariants): that helper covers &T references, while this one covers NonNull<T> / Box<T> pointer fields whose pointee is decomposed by init_ptr_field (e.g. NodeRef.node: NonNull<LeafNode> must satisfy LeafNode’s len <= CAPACITY).

Source

fn eval_pointee_predicate_as_bool( &self, alloc_id: AllocId, view_ty: Ty<'tcx>, pred: &NumericPredicate<'tcx>, ) -> Option<Bool<'z3>>

Evaluate a ValidNum predicate against a pointee allocation (not a MIR local): field places resolve through MemoryContent::values keyed by the pointee type.

Source

fn eval_pointee_expr( &self, alloc_id: AllocId, view_ty: Ty<'tcx>, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>

Evaluate a numeric ContractExpr against a pointee allocation.

Source

fn eval_pointee_expr_value( &self, alloc_id: AllocId, view_ty: Ty<'tcx>, expr: &ContractExpr<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>

Resolve a Place (or Len inner) against a pointee allocation, returning the materialized VmValue so slice-length fallbacks can read provenance.

Source

fn set_align_for_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )

Set align invariant on the target value.

Source

fn set_init_for_value( &mut self, property: &Property<'tcx>, val: VmValue<'z3, 'tcx>, )

Set init invariant on the target value and its allocation.

Source

fn set_owning_for_value(&mut self, val: VmValue<'z3, 'tcx>)

Set owning invariant on the target value.

Source

fn for_each_target_alloc(&self, property: &Property<'tcx>) -> Option<AllocId>

Source

fn record_for_each_align(&mut self, property: &Property<'tcx>)

Record the Align(container.iter(), T) for_each fact: every element pointer is aligned to align_of(T). Anchored to the container allocation so a pointer loaded from it can discharge Align(cur, T).

Source

fn record_for_each_allocated(&mut self, property: &Property<'tcx>)

Record the Allocated(container.iter(), T, n) for_each fact: every element pointer backs >= n T elements (n may be symbolic).

Source

fn record_for_each_owning(&mut self, property: &Property<'tcx>)

Record the Owning(container.iter()) for_each fact: every element pointer is the sole owner of its pointee. Anchored to the container allocation so a pointer loaded from it can discharge Owning(cur).

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn bound_contract_place_value( &self, place: &ContractPlace, ) -> Option<VmValue<'z3, 'tcx>>

Resolve a contract place already bound to this frame’s locals.

Source

fn eval_contract_fact_tree(&self, expr: &ContractExpr<'tcx>) -> Option<Int<'z3>>

Source

pub(crate) fn eval_contract_expr_simple( &self, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>

Source

fn eval_contract_expr_simple_leaf( &self, expr: &ContractExpr<'tcx>, ) -> Option<Int<'z3>>

Source

fn eval_contract_expr_simple_value( &self, expr: &ContractExpr<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>

Source

fn try_simple_iter_len(&self, arg_val: &VmValue<'z3, 'tcx>) -> Option<Int<'z3>>

Source

pub(crate) fn is_local_adt_receiver(&self, value: &VmValue<'z3, 'tcx>) -> bool

Source

pub(crate) fn contract_binary_term( &self, op: BinOp, left: &Int<'z3>, right: &Int<'z3>, ) -> Option<Int<'z3>>

Source

pub(crate) fn contract_unary_term( &self, op: UnaryOp, value: &Int<'z3>, ) -> Int<'z3>

Source

pub(crate) fn contract_relop_bool( &self, op: RelOp, left: &Int<'z3>, right: &Int<'z3>, ) -> Bool<'z3>

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn execute_items(self, items: &[RelevantItem<'tcx>]) -> Vec<Self>

Execute all retained MIR items in path order.

Source

pub(crate) fn execute_items_after( states: Vec<Self>, items: &[RelevantItem<'tcx>], ) -> Vec<Self>

Source

pub(crate) fn execute_items_after_with_cleanup( states: Vec<Self>, items: &[RelevantItem<'tcx>], ) -> Vec<Self>

Replay items while retaining a selected cleanup successor after a call.

Source

fn execute_items_after_inner( states: Vec<Self>, items: &[RelevantItem<'tcx>], retain_cleanup: bool, ) -> Vec<Self>

Source

fn execute_item( &mut self, item: &RelevantItem<'tcx>, retain_cleanup: bool, ) -> bool

Source

fn handle_callee_entry( &mut self, callee: DefId, body: Option<&'tcx Body<'tcx>>, args: &[CallArg], )

Enter an inlined callee during path execution: save the caller context, switch to the callee body, and bind the caller’s argument locals to the callee’s parameters.

Source

fn handle_callee_exit(&mut self, dest: usize)

Exit an inlined callee: capture the callee’s return value, restore the caller context, and write the return value to the caller’s destination.

Source

pub(super) fn recover_leaked_owner_shares(&mut self, callee: DefId)

A ManuallyDrop<Owner> retained at return keeps its strong share alive.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn eval_contract_method( &self, method: DefId, receiver: VmValue<'z3, 'tcx>, receiver_local: Option<Local>, args: Vec<Int<'z3>>, ) -> Option<Int<'z3>>

Source

fn eval_contract_method_paths( &self, method: DefId, values: &[VmValue<'z3, 'tcx>], receiver_local: Option<Local>, ) -> Option<Int<'z3>>

Source

pub(super) fn exec_inline_call( &mut self, callee_def_id: DefId, instance: Option<Instance<'tcx>>, call_args: &[Spanned<Operand<'tcx>>], arg_values: &[VmValue<'z3, 'tcx>], caller_arg_locals: &[Option<Local>], dest: Local, ) -> bool

Recursively execute a callee’s MIR body inline.

Binds the caller’s argument values to the callee’s parameters, executes the callee’s MIR, and writes the return value to the caller’s destination local. Returns whether the call may return.

Source

fn forget_inline_referent(&mut self, local: Local)

Source

fn inline_execute_body(&mut self, pre_uninit: &[AllocId]) -> Option<Vec<Self>>

Source

fn inline_execute_single(&mut self) -> InlineStep<'z3, 'tcx>

Source

fn inline_execute_branches( &mut self, pre_uninit: &[AllocId], pending: Vec<(VmExecutor<'z3, 'tcx>, BasicBlock, FxHashSet<BasicBlock>)>, ) -> Option<Vec<Self>>

Source

fn find_uninit_witness( &self, switch: &Terminator<'tcx>, candidates: &[AllocId], ) -> FxHashSet<AllocId>

Source

fn allocation_needs_write(&self, id: AllocId) -> bool

Source

pub(crate) fn replay_deferred_writes( &mut self, writes: Vec<(Local, Vec<usize>, VmValue<'z3, 'tcx>)>, )

Source

pub(crate) fn find_whole_borrow_referent(&self, local: Local) -> Option<Local>

Resolve a direct mutable borrow or a whole-place reborrow back to its referent local. Used to propagate the referent’s materialized field values into an inlined callee when the reborrow temp’s own forward assignment was pruned from the slice (so its value is still the stack-address default and find_local_by_address can only self-match). Deliberately excludes field reborrows (&mut (*_x).field) — those address a subfield, whose value is tracked separately, so propagating the whole struct’s fields would be wrong (BTreeMap’s NodeRef handles).

Source

pub(crate) fn find_field_reborrow_referent( &self, local: Local, ) -> Option<(Local, Vec<usize>)>

Resolve a field reborrow (_7 = &mut (*_x).field, projection [Deref, Field(..)*]) back to its referent local plus the field path.

Source

pub(crate) fn find_copy_root(&self, local: Local) -> Option<Local>

Resolve a whole-place copy root: _x = copy _y / _x = move _y (no projection) traces _x back to _y. Used to recover a value parameter’s materialized fields when the optimizer inserted a copy temporary between the caller’s argument and the inlined callee’s parameter (e.g. get_ext’s _2 = copy _1 before NonZero::get(move _2)), so that handle_callee_entry’s field collection can follow the copy chain to the local that actually carries the fields.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn diagnostics(&self) -> &Diagnostics

Source

pub(crate) fn recover_copy_memory_target(&mut self, before: &Diagnostics)

Source

pub(crate) fn recover_missing_mir(&mut self, before: &Diagnostics)

Source

pub(crate) fn current_def_id(&self) -> DefId

Source

pub(crate) fn local_alloc_id(&self, local: Local) -> Option<AllocId>

Source

pub(crate) fn local_allocations( &self, ) -> impl Iterator<Item = (Local, AllocId)> + '_

Source

pub(crate) fn cached_size(&self, ty: Ty<'tcx>) -> Option<&Int<'z3>>

Source

pub(crate) fn incomplete_inline_terms( &self, ) -> impl Iterator<Item = &FxHashSet<Int<'z3>>>

Source

pub(crate) fn opaque_intrinsic_terms(&self) -> &FxHashSet<Int<'z3>>

Source

pub(crate) fn has_matching_index_access_fact( &self, slice_val: &VmValue<'z3, 'tcx>, index_val: &VmValue<'z3, 'tcx>, ) -> bool

Source

pub(crate) fn enable_memory_events(&mut self)

Source

pub(crate) fn memory_events(&self) -> Option<Ref<'_, Vec<MemoryEvent>>>

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn iter_ptr_end( &self, local: Local, ) -> Option<(VmValue<'z3, 'tcx>, VmValue<'z3, 'tcx>)>

The two pointer fields of an Iter/IterMut local ([0] = ptr, [1] = end_or_len), which share the same allocation. Returns None when either field is missing or the two point into different allocations.

Source

pub(crate) fn iter_elem_size(&self, ptr: &VmValue<'z3, 'tcx>) -> Int<'z3>

Element size of the type iterated by an Iter/IterMut pointer, symbolic (sizeof_T) for a generic element type so size / elem_size cancels.

Source

pub(crate) fn iter_len_from_ptrs( &self, ptr: &VmValue<'z3, 'tcx>, end: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>

Element count from two pointer fields sharing the same allocation: (end.offset - ptr.offset) / elem_size. When both pointers carry an element-structured offset (OffsetKind::Element, or the base), the count is computed element-wise (end_elem - ptr_elem) so the (end·S - ptr·S)/S division is avoided for a generic element size S.

Source

pub(crate) fn iter_ptr_comparison( &mut self, op: BinOp, lhs: &VmValue<'z3, 'tcx>, rhs: &VmValue<'z3, 'tcx>, ) -> Option<Bool<'z3>>

Compare pointers by their MIR-derived element indices when they use the same positive byte stride. The tracked std iterator offset remains a fallback when an element index is unavailable.

Source

pub(crate) fn track_iter_ptr_update(&mut self, local: Local)

If local is a reference to Iter/IterMut and field 0 (ptr) is updated, increment the cumulative ptr offset so that interpreter_iter_len can express len = initial_len - offset instead of nested (end - (ptr + sz + sz + ...)) / sz.

Source

fn iter_buffer(&self, local: Local) -> Option<AllocId>

The buffer an Iter/IterMut at local walks: the provenance of its end field. This is frame-independent (the buffer allocation is path-scoped), unlike the local itself. The iterator’s own allocation keys its element index in iter_ptr_offset.

Source

pub(crate) fn iter_utf8_buffer( &self, local: Local, ) -> Option<(AllocId, Int<'z3>)>

The byte buffer walked by an iterator at local, possibly wrapped in adapter types (Cloned/Rev/…). Rvalue::Aggregate flattens nested adapters, so the innermost Iter/IterMut end pointer is any tracked field whose path ends in [1]. Return its allocation and end offset (the end offset doubles as the byte length when the element is u8).

Source

pub(crate) fn is_iter_ref(&self, val: &VmValue<'z3, 'tcx>) -> bool

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn prewarm_generic_size_align(&mut self)

Pre-warm a shared symbolic sizeof_T / align_T for every generic type parameter of the caller, so the read-only *_sym_read fallback is dead.

Source

pub(crate) fn materialize_external_field( &mut self, local: Local, idx: usize, field_ty: Ty<'tcx>, elem_ty: Ty<'tcx>, alive_region: Option<Region<'tcx>>, )

Materialize a struct field holding a reference (&T / &[T]), a DST slice ([T]), or a heap-backed smart pointer (Box/Vec) as an external allocation, so field access (e.g. self.buckets.iter(), as_ptr()) resolves to the data rather than the whole struct. The caller pre-computes elem_ty (the pointee / slice element). alive_region carries the lifetime of a reference field (&'a T), marking its referent alive for 'a (a reference guarantees its referent is alive); a raw slice / Box / Vec field carries no such guarantee and passes None.

Source

fn materialize_external_field_at( &mut self, local: Local, path: Vec<usize>, field_ty: Ty<'tcx>, elem_ty: Ty<'tcx>, alive_region: Option<Region<'tcx>>, )

Materialize an external allocation and bind it as the value at path, carrying data provenance and an optional liveness region. Slice fields receive symbolic length metadata; other fields retain an unknown extent. Shared by the whole-field (materialize_external_field) and pointer-subfield (materialize_vec_ptr_field) materialization paths.

Source

pub(crate) fn init_ptr_field( &mut self, local: Local, path: Vec<usize>, field_ty: Ty<'tcx>, pointee: Ty<'tcx>, local_idx: usize, idx: usize, elem_alloc: &mut FxHashMap<Ty<'tcx>, (AllocId, Int<'z3>)>, is_raw_ptr: bool, nn_fresh_prefix: &str, )

Initialize one pointer-like field (raw pointer or NonNull<T>) of a decomposed struct/ref parameter. The first field with a given pointee type creates a shared external allocation; later fields with the same pointee reuse it with a symbolic offset, preserving relationships like ptr = start, end_or_len = start + len.

Source

fn unsized_tail_layout(&self, ty: Ty<'tcx>) -> Option<(Ty<'tcx>, u64)>

Source

pub(crate) fn decompose_adt_fields( &mut self, local: Local, prefix: Vec<usize>, ty: Ty<'tcx>, local_idx: usize, elem_alloc: &mut FxHashMap<Ty<'tcx>, (AllocId, Int<'z3>)>, depth: usize, )

Recursively decompose a (possibly nested) struct parameter into per-field symbolic values. Nested ADT fields (e.g. Handle { node: NodeRef { node: NonNull<LeafNode>, .. }, .. }) are descended into so their NonNull / raw-pointer leaves get external-allocation provenance — otherwise a NonNull buried two levels deep loses its provenance and downstream Allocated/Init checks (e.g. descend’s edges.get_unchecked) fail.

Source

pub(crate) fn materialize_vec_ptr_field( &mut self, local: Local, prefix: Vec<usize>, field_ty: Ty<'tcx>, ) -> bool

Materialize only the owning pointer field of a non-generic Vec-like ADT field (e.g. struct Vec { ptr: NonNull<u8>, len, cap }), so an inlined Vec::as_ptr’s _2 = copy (*self).ptr resolves to the data provenance. The scalar len/cap fields are deliberately left unmaterialized — their ValidNum invariants are established separately by the struct-invariant assertion, not by fresh unconstrained symbols (which would fail ValidNum). The caller has already ensured field_ty is a non-enum Vec.

Source

fn field_term_from_bytes( &self, alloc_id: AllocId, offset: usize, size: usize, ) -> Option<Int<'z3>>

Read a scalar field’s value back out of the byte layer over [offset, offset + size) (little-endian). Returns None when the byte layer does not cover the whole field (a hole, or no byte written), so the caller falls back to a fresh symbol.

This is the byte→field direction of the cast cross-view materialization: when bytes are written first (*buf = 3) and the buffer is then reinterpreted as a repr(C) struct, the field value is those bytes, not an unrelated fresh symbol.

Source

pub(crate) fn decompose_pointee_fields( &mut self, alloc_id: AllocId, prefix: Vec<usize>, ty: Ty<'tcx>, root_ty: Ty<'tcx>, local_idx: usize, depth: usize, byte_offset: usize, )

Recursively decompose a pointee ADT’s fields into per-allocation field tracking, mirroring decompose_adt_fields but keyed by allocation instead of local. This is what lets a &*NonNull<LeafNode> dereference resolve (*leaf).len to the actual len field value rather than the raw pointer term.

byte_offset is the running byte offset of the field being decomposed, used for the byte→field cross-view materialization (see Self::field_term_from_bytes).

Source

pub(crate) fn try_materialize_const_bytes( &mut self, val: &mut VmValue<'z3, 'tcx>, operand: &Operand<'tcx>, )

If operand is a constant reference to a byte array (e.g. b"hello\0"), extract the raw bytes and create a tracked allocation. Updates val in-place with the proper provenance and invariants.

Source

pub(crate) fn trace_to_const_bytes( &self, operand: &Operand<'tcx>, ) -> Option<Vec<u8>>

Source

pub(crate) fn propagate_field_values_to_ref( &mut self, source_place: &Place<'tcx>, dest: Local, )

Propagate a source place’s per-field values to a reference destination, shifting the field path by the source place’s Field projection prefix. E.g. for _3 = &(_1.0) where _1 is a Handle { node: NodeRef { node: NonNull<..>, .. }, .. }, the nested NonNull’s field value stored at path [0, 1] becomes available at _3’s path [1], so an inlined callee that dereferences _3 and reads its node field sees the provenance of the underlying allocation.

Source

pub(crate) fn propagate_byte_values_to_ref( &mut self, source_place: &Place<'tcx>, ref_val: &VmValue<'z3, 'tcx>, )

Source

pub(crate) fn aggregate_field_tys(&self, ty: Ty<'tcx>) -> Vec<Ty<'tcx>>

Return the per-field types for an aggregate’s operands.

Source

pub(crate) fn materialize_vec_fields( &mut self, local: Local, ptr: VmValue<'z3, 'tcx>, cap: Int<'z3>, len: Int<'z3>, )

Materialize the {ptr, cap, len} field values of a Vec<T> aggregate at local. The backing-buffer pointer is written to the owning raw pointer field (located generically via Self::container_ptr_field); the len/cap are no longer materialized as fields — they are asserted as path conditions and tracked by the backing allocation’s slice length.

The symbolic invariant 0 <= len <= cap and cap * elem_size <= isize::MAX is asserted as a path condition so downstream len() / capacity() / InBound / ValidNum queries agree.

Source

pub(crate) fn materialize_vec_len_cap( &mut self, cap: Int<'z3>, len: Int<'z3>, elem_size: u64, )

Assert the Vec length/capacity invariants 0 <= len <= cap and cap * elem_size <= isize::MAX as path conditions.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn bounded_span( &self, value: &VmValue<'z3, 'tcx>, ty: Ty<'tcx>, ) -> Option<(Int<'z3>, Ty<'tcx>, Option<Int<'z3>>)>

The key of a bounded span. Unsized slices and strings also need their length.

Source

pub(crate) fn copy_memory_values( &mut self, source: &VmValue<'z3, 'tcx>, target: &VmValue<'z3, 'tcx>, count: &VmValue<'z3, 'tcx>, )

Source

pub(crate) fn forget_memory_values(&mut self, alloc_id: AllocId)

Source

pub(crate) fn swap_memory_values( &mut self, left: &VmValue<'z3, 'tcx>, right: &VmValue<'z3, 'tcx>, ) -> bool

Source

pub(crate) fn clear_write_evidence(&mut self, alloc_id: AllocId)

Source

pub(crate) fn write_provenance_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, value: VmValue<'z3, 'tcx>, ) -> bool

Source

fn write_reinterpreted_integer_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, value: VmValue<'z3, 'tcx>, ) -> bool

A typed whole-object write through a cast pointer replaces the start of an integer buffer while keeping its original allocation element type.

Source

pub(crate) fn invalidate_provenance_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, )

Source

fn write_field_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, value: VmValue<'z3, 'tcx>, ) -> bool

Source

pub(crate) fn read_field_allocation( &self, pointer: &VmValue<'z3, 'tcx>, pointee_ty: Ty<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>

Source

fn field_path_at_offset( &self, ty: Ty<'tcx>, offset: u64, target_ty: Ty<'tcx>, ) -> Option<Vec<usize>>

Source

fn write_indexed_allocation( &mut self, pointer: &VmValue<'z3, 'tcx>, value: VmValue<'z3, 'tcx>, ) -> bool

Source

pub(crate) fn address_of_place( &mut self, place: &Place<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>

Source

pub(crate) fn ensure_local_allocation(&mut self, local: Local)

Lazily create a stack allocation for a MIR local if one doesn’t exist.

Source

pub(crate) fn field_offset_in_bytes( &self, ty: Ty<'tcx>, field_idx: usize, ) -> u64

Source

pub(crate) fn size_of_ty(&self, ty: Ty<'tcx>) -> u64

Source

pub(crate) fn align_of_ty(&self, ty: Ty<'tcx>) -> u64

Source

pub(crate) fn allocation_size(&self, alloc_id: AllocId) -> &Int<'z3>

Source

pub(crate) fn allocation_base(&self, alloc_id: AllocId) -> &Int<'z3>

Source

pub(crate) fn pointee_elem_size(&self, ty: Ty<'tcx>) -> u64

Get the element size (in bytes) for a pointer type, peeling through *const T, *mut T, &T, and &[T] to find size_of(T).

Source

pub(crate) fn size_sym(&mut self, ty: Ty<'tcx>) -> Int<'z3>

Element size of ty as a symbolic Z3 term. For concrete types this is the constant byte size; for a generic type whose size_of is unknown (an unconstrained T) it is a single reusable symbolic constant with >= 0 (so T may be a ZST). Using the same constant everywhere (ptr strides, access counts, allocation sizes) lets SMT cancel the factor in InBound.

Source

pub(crate) fn const_len_term(&self, const_len: &Const<'tcx>) -> Int<'z3>

The array length N as a Z3 term (concrete value or symbolic const generic). The symbolic name mirrors value_of_operand’s formatting so it is identical to the const N term appearing in path conditions.

Source

pub(crate) fn size_sym_read(&self, ty: Ty<'tcx>) -> Int<'z3>

Read-only sibling of size_sym: returns the symbolic size for ty, falling back to 1 when the symbolic constant has not been created yet (e.g. a checker invoked before the exec phase created it). Non-ZST concrete types return their constant byte size; a concrete ZST or a not-yet-created generic constant falls back to 1 — a non-zero element size keeps size / elem_size derivations from dividing by zero.

Source

pub(crate) fn generic_elem_size(&self, alloc_id: AllocId) -> Option<Int<'z3>>

The symbolic element-size term of alloc_id’s element type, when it is a generic type parameter (so it may be 0 for a ZST or ≥ 1 for a non-ZST). Returns None for concrete element types, where the size is a known constant and no case split is needed.

Source

pub(crate) fn align_sym(&mut self, ty: Ty<'tcx>) -> Int<'z3>

Alignment of ty as a symbolic Z3 term. For a concrete type this is the constant byte alignment; for a generic type it is a reusable symbolic constant align_T with >= 1, lower-bounded by the trait bounds’ minimum alignment, and linked to the element size by the layout constraint sizeof_T % align_T == 0 (a type’s size is always a multiple of its alignment). For a generic struct, its alignment is additionally constrained to be a multiple of each field’s alignment, so a field pointer ((*node).value) inherits the container’s alignment.

Source

pub(crate) fn align_sym_read(&self, ty: Ty<'tcx>) -> Int<'z3>

Read-only sibling of align_sym: returns the symbolic alignment for ty, falling back to the trait bounds’ minimum alignment when the constant has not been created yet (e.g. a generic U that only appears in a cast/contract, never as an allocation element type). Concrete types return their constant alignment.

Source

pub(crate) fn struct_size_sym(&mut self, ty: Ty<'tcx>) -> Option<Int<'z3>>

Size of a struct/ADT as the sum of its fields’ sizes (each via size_sym). This lower-bounds the real layout so a field reference (Allocated(&alloc)) can be discharged against the struct allocation (sizeof_A <= 8 + 8 + sizeof_A). Returns None for non-ADT or enum types.

Source

fn uninit_byte(&self) -> Int<'z3>

The shared UNINIT sentinel (≥ 256, outside the u8 range).

Source

fn fresh_byte_array(&self) -> Array<'z3>

A fresh Array<Int, Int> whose every offset reads UNINIT.

Source

pub(crate) fn byte_read(&self, alloc_id: AllocId, i: &Int<'z3>) -> Int<'z3>

Read byte[i] at a (possibly symbolic) offset; unwritten offsets read UNINIT.

The result is simplified so a select(store(…), i) chain (built up by repeated byte_write / copy_byte_tracking) collapses to its constant byte value when i is concrete, rather than leaking the nested select/store expression into downstream SMT obligations.

Source

pub(crate) fn fill_byte_array( &mut self, pointer: &VmValue<'z3, 'tcx>, byte: u64, ) -> bool

Source

pub(crate) fn byte_write( &mut self, alloc_id: AllocId, i: &Int<'z3>, v: &Int<'z3>, )

Write byte[i] = v.

Source

pub(crate) fn record_byte_value( &mut self, alloc_id: AllocId, offset: usize, term: Int<'z3>, )

Record a per-byte symbolic value at a concrete offset in an allocation.

Source

pub(crate) fn mark_byte_init(&mut self, alloc_id: AllocId, offset: usize)

Mark a byte as initialized (written) with an unknown value.

Source

pub(crate) fn is_byte_init(&self, alloc_id: AllocId, offset: usize) -> bool

Whether a byte at a concrete offset was written (select != UNINIT).

Source

pub(crate) fn is_byte_nul(&self, alloc_id: AllocId, offset: usize) -> bool

Whether a byte at a concrete offset is known NUL.

Source

pub(crate) fn is_byte_non_nul(&self, alloc_id: AllocId, offset: usize) -> bool

Whether a byte at a concrete offset is known non-NUL.

Source

pub(crate) fn alloc_byte_values( &self, alloc_id: AllocId, ) -> Vec<(usize, Int<'z3>)>

Enumerate (offset, term) pairs for the written bytes of an allocation, in ascending offset order.

Source

pub(crate) fn alloc_nul_offsets(&self, alloc_id: AllocId) -> Vec<usize>

Offsets known to be NUL.

Source

pub(crate) fn alloc_non_nul_offsets(&self, alloc_id: AllocId) -> Vec<usize>

Offsets known to be non-NUL.

Source

pub(crate) fn copy_byte_tracking( &mut self, src: AllocId, src_offset: usize, dst: AllocId, )

Copy the per-byte state (values + written-offset bound) of one allocation to another, shifting by src_offset so dst[i] = src[i + src_offset].

Source

pub(crate) fn load_value( &self, alloc_id: AllocId, view_ty: Ty<'tcx>, path: &[usize], ) -> Option<&VmValue<'z3, 'tcx>>

The value at a field offset within an allocation viewed as view_ty.

This is the memory-contents (typed-value) layer (MemoryContent::values): the single source of truth for field values. Self::field_value is the local-facing wrapper that resolves a MIR local’s backing allocation and declared type, then reads this same layer. The viewed type is part of the key so reinterpret casts (LeafNode ↔ InternalNode) resolve to the right field view.

Source

pub(crate) fn store_value( &mut self, alloc_id: AllocId, view_ty: Ty<'tcx>, path: Vec<usize>, value: VmValue<'z3, 'tcx>, )

Store a value at a field offset within an allocation viewed as view_ty.

This is the write counterpart to Self::load_value on the same memory-contents layer (MemoryContent::values); the viewed type is part of the key so reinterpret casts resolve to the right field view.

Source

pub(crate) fn utf8_validity(&self, alloc_id: AllocId) -> Option<Bool<'z3>>

Encode the UTF-8 validity DFA over this allocation’s tracked bytes. Returns None when no bytes are tracked (validity is trivially satisfied), so callers can short-circuit to “proved”.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn find_local_by_address(&self, term: &Int<'z3>) -> Option<Local>

Find the local whose symbolic address matches term (the address a reference value points at). Used to resolve a &self/&mut self receiver (often a reborrow temp) back to the referent local that carries the materialized field values.

Source

pub(crate) fn write_through_pointer( &mut self, pointer: &VmValue<'z3, 'tcx>, path: Vec<usize>, value: VmValue<'z3, 'tcx>, ) -> bool

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn begin_method_call( &self, method: DefId, receiver: &VmValue<'z3, 'tcx>, receiver_local: Option<Local>, ) -> Option<MethodSnapshot<'z3, 'tcx>>

Source

pub(crate) fn finish_method_call( &mut self, snapshot: Option<MethodSnapshot<'z3, 'tcx>>, result: Option<&VmValue<'z3, 'tcx>>, )

Source

pub(crate) fn cached_method_result( &self, method: DefId, receiver: &VmValue<'z3, 'tcx>, ) -> Option<Int<'z3>>

Source

fn method_snapshot_matches(&self, snapshot: &MethodSnapshot<'z3, 'tcx>) -> bool

Source

fn snapshot_field(&self, value: &VmValue<'z3, 'tcx>) -> FieldSnapshot<'z3, 'tcx>

Source

fn field_matches( &self, value: &VmValue<'z3, 'tcx>, old: &FieldSnapshot<'z3, 'tcx>, ) -> bool

Source

fn method_owner_local(&self, receiver: &VmValue<'z3, 'tcx>) -> Option<Local>

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn apply_function_var_effect( &mut self, args: &[VmValue<'z3, 'tcx>], caller_arg_locals: &[Option<Local>], dest: Local, callee: DefId, )

Abstract a safe Fn* call when only a scalar boolean or Ordering result is required. The closure body is unavailable at a generic call site, so every allocation outside the active frame may have been reached through captures or globals. Locals explicitly passed by reference are also invalidated. Frame-private counters remain stable.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(super) fn prepare_comparison( &self, callee: Option<DefId>, args: &[VmValue<'z3, 'tcx>], destination: Local, ) -> Option<ComparisonPlan<'z3>>

Source

pub(super) fn apply_comparison( &mut self, plan: ComparisonPlan<'z3>, destination: Local, )

Source

fn scalar_comparison( &self, method: ComparisonMethod, left: &VmValue<'z3, 'tcx>, right: &VmValue<'z3, 'tcx>, ) -> Option<Bool<'z3>>

A reference to a primitive scalar compares its stored value, not its address. Floats are excluded because this integer model cannot express NaN.

Source

fn byte_slice_eq( &self, left: &VmValue<'z3, 'tcx>, right: &VmValue<'z3, 'tcx>, ) -> Option<Bool<'z3>>

Compare a tracked [u8] view with a fully materialized constant byte array. The result is len == N && bytes[0..N] == constant.

Source

fn byte_slice_const_eq( &self, slice: &VmValue<'z3, 'tcx>, constant: &VmValue<'z3, 'tcx>, ) -> Option<Bool<'z3>>

Source

fn constant_bytes(&self, value: &VmValue<'z3, 'tcx>) -> Option<Vec<u8>>

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn materialize_constructor_result( &mut self, destination: Local, args: &[VmValue<'z3, 'tcx>], first_operand: Option<&Operand<'tcx>>, callee: DefId, has_invariant: bool, )

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(super) fn apply_memory_effect( &mut self, effect: &CallEffect, args: &[VmValue<'z3, 'tcx>], dest: Local, )

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

fn apply_binary_num( &mut self, dest: Local, args: &[VmValue<'z3, 'tcx>], lhs_arg: usize, rhs_arg: usize, f: impl Fn(&Int<'z3>, &Int<'z3>) -> Int<'z3>, )

Source

pub(super) fn apply_numeric_effect( &mut self, effect: &CallEffect, args: &[VmValue<'z3, 'tcx>], dest: Local, )

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(super) fn apply_simd_effect( &mut self, effect: &CallEffect, args: &[VmValue<'z3, 'tcx>], caller_arg_locals: &[Option<Local>], dest: Local, )

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

fn set_dest_as_heap_ptr(&mut self, arg_val: &VmValue<'z3, 'tcx>, dest: Local)

Source

pub(crate) fn apply_call_effect( &mut self, effect: &CallEffect, args: &[VmValue<'z3, 'tcx>], caller_arg_locals: &[Option<Local>], call_args: &[Spanned<Operand<'tcx>>], dest: Local, func: &Operand<'tcx>, )

Source

fn simd_lane_type(&self, ty: Ty<'tcx>) -> Option<(Ty<'tcx>, usize)>

Source

fn set_opaque_simd_result(&mut self, dest: Local)

Source

fn copy_simd_result_from_local(&mut self, dest: Local, source: Local) -> bool

Source

fn set_opaque_intrinsic_result(&mut self, dest: Local)

Source

fn set_external_container_result( &mut self, dest: Local, alloc_id: AllocId, base: Int<'z3>, elem_ty: Option<Ty<'tcx>>, ) -> Option<VmValue<'z3, 'tcx>>

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(super) fn prepare_builtin_index( &self, callee: Option<DefId>, args: &[VmValue<'z3, 'tcx>], arg_locals: &[Option<Local>], dest: Local, ) -> Option<BuiltinIndexPlan<'z3, 'tcx>>

Source

pub(super) fn apply_builtin_index( &mut self, plan: BuiltinIndexPlan<'z3, 'tcx>, dest: Local, )

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

fn select_call_model( &self, site: &CallSite<'_, 'z3, 'tcx>, drop_call: Option<DropCall>, ) -> CallModel<'z3, 'tcx>

Source

fn execute_call_model( &mut self, model: CallModel<'z3, 'tcx>, site: &CallSite<'_, 'z3, 'tcx>, ) -> RuleFlow

Source

fn finish_call( &mut self, site: &CallSite<'_, 'z3, 'tcx>, prior_result: Option<&Int<'z3>>, summary_used: bool, method_call: Option<MethodSnapshot<'z3, 'tcx>>, )

Source

fn finish_call_state( &mut self, site: &CallSite<'_, 'z3, 'tcx>, prior_result: Option<&Int<'z3>>, summary_used: bool, method_call: Option<MethodSnapshot<'z3, 'tcx>>, )

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

fn provenance_for_binary_op( &self, op: BinOp, lhs: &VmValue<'z3, 'tcx>, rhs: &VmValue<'z3, 'tcx>, ) -> Option<Provenance<'z3>>

Compute provenance for a binary operation on pointer values. Propagates provenance with adjusted offset for pointer arithmetic (ptr + offset, ptr - offset, Offset).

Source

fn facts_for_binary_op( &self, op: BinOp, lhs: &VmValue<'z3, 'tcx>, rhs: &VmValue<'z3, 'tcx>, provenance: &Option<Provenance<'z3>>, ) -> ValueFacts<'z3>

Compute facts for a binary operation. Propagates non_null from pointer arithmetic and align_n from compatible ops.

Source

fn rhs_is_aligned_multiple( &self, val: &VmValue<'z3, 'tcx>, align: &Int<'z3>, ) -> bool

Check if a value is known to be a multiple of align (e.g. the result of a Mul by a constant factor of align).

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

fn record_projected_store( &mut self, place: &Place<'tcx>, value: &VmValue<'z3, 'tcx>, )

Record byte-level values when assigning to a place with projections. This handles patterns like buf[i] = 0u8 (nul-store) and arr[i] = val.

Source

fn record_indexed_store( &mut self, place: &Place<'tcx>, value: &VmValue<'z3, 'tcx>, )

Track byte-level values for index-based stores (e.g. buf[i] = 0u8) that record_projected_store skips due to Index projections.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

fn op_source_of( &self, pk: &PlaceKey, ) -> Option<(Option<PlaceKey>, Option<PlaceKey>, BinOp)>

The (lhs, rhs, op) of the binary-op/comparison source recorded on the value bound to pk’s local, if any.

Source

fn operand_place_key(op: &Operand<'tcx>) -> Option<PlaceKey>

Source

fn infer_guard_align(&mut self, cond: &Operand<'tcx>, expected: bool)

Infer alignment constraints from guards of the form (x % n) == 0.

Source

fn mark_align_n(&mut self, src_pk: &Option<PlaceKey>, align: Int<'z3>)

Source

fn infer_guard_non_null(&mut self, cond: &Operand<'tcx>, expected: bool)

Infer non_null invariants from branch guards.

Source

fn infer_switch_guard(&mut self, discr: &Operand<'tcx>)

Infer non_null from SwitchInt discriminant.

Source

fn mark_guard_pointer(&mut self, lhs: &Option<PlaceKey>, rhs: &Option<PlaceKey>)

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(super) fn init_struct_param( &mut self, local: Local, ty: Ty<'tcx>, local_idx: usize, invariants: &mut ValueFacts<'z3>, ) -> bool

Initialize a struct/tuple/enum parameter (a non-Box/Vec ADT): decompose it into per-field symbolic values for field-level checking.

Source

pub(crate) fn init_box_vec_param( &mut self, local: Local, ty: Ty<'tcx>, local_idx: usize, invariants: &mut ValueFacts<'z3>, ) -> bool

Initialize a Box/Vec/CString parameter: allocate its heap pointee, expose the owning pointer field, and (for Vec) bind symbolic len/cap.

Source

pub(super) fn init_array_param( &mut self, local: Local, ty: Ty<'tcx>, local_idx: usize, invariants: &mut ValueFacts<'z3>, ) -> bool

Initialize an array parameter ([T; N]): give it a real allocation with provenance so downstream call effects can record the alloc_id.

Source

pub(super) fn init_reference_param( &mut self, local: Local, ty: Ty<'tcx>, local_idx: usize, invariants: &mut ValueFacts<'z3>, ) -> bool

Initialize a reference parameter (&T, &mut T): create a symbolic allocation for the pointee, attach provenance, and (for a struct pointee) materialize its pointer/scalar fields.

Source

pub(super) fn propagate_entry_block_provenance(&mut self)

Propagate parameter provenance through the entry block’s simple assignments (_tmp = _1, _tmp = _1 as *const T), which the backward slicer may omit as same-block definitions.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn init_parameters(&mut self)

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn apply_slice_offset( &mut self, dest: Local, base: &VmValue<'z3, 'tcx>, index: &VmValue<'z3, 'tcx>, index_local: Local, ) -> bool

Source

pub(crate) fn slice_index_start( &self, index: &VmValue<'z3, 'tcx>, index_local: Local, ) -> Option<Int<'z3>>

Source

pub(crate) fn slice_index_output_len( &self, base: &VmValue<'z3, 'tcx>, index: &VmValue<'z3, 'tcx>, index_local: Local, ) -> Option<Int<'z3>>

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn ownership_share( &self, value: &VmValue<'z3, 'tcx>, owner: DefId, ) -> Option<usize>

Source

pub(crate) fn has_available_transfer(&self, alloc_id: AllocId) -> bool

Source

pub(crate) fn begin_ownership_transfer(&mut self, local: Local, owner: DefId)

Source

pub(crate) fn grant_ownership_share( &mut self, value: &VmValue<'z3, 'tcx>, owner: DefId, )

Source

pub(crate) fn consume_ownership_share( &mut self, value: &VmValue<'z3, 'tcx>, owner: DefId, may_free: bool, )

Source

pub(crate) fn record_memory_drop(&mut self, alloc_id: AllocId, local: Local)

Source

pub(crate) fn record_memory_use(&self, alloc_id: AllocId, local: Local)

Source

pub(crate) fn scalar_bits_term( &self, ty: Ty<'tcx>, bits: u128, ) -> Option<Int<'z3>>

Source

pub(crate) fn u128_term(&self, value: u128) -> Int<'z3>

Source

pub(crate) fn enum_discriminant_term( &self, ty: Ty<'tcx>, variant: VariantIdx, ) -> Option<Int<'z3>>

Source

pub(crate) fn body(&self) -> &'tcx Body<'tcx>

MIR for the current frame, preferring its selected generic instantiation.

Source

pub(crate) fn body_for(&self, def_id: DefId) -> &'tcx Body<'tcx>

Source

pub(crate) fn target_body(&self) -> &Body<'tcx>

MIR for the verification target, preferring its selected generic instantiation.

Source

pub(crate) fn record_unsupported(&mut self, operation: &str)

Source

pub(crate) fn record_unsupported_effect(&mut self, effect: &str)

Source

pub(crate) fn record_missing_mir(&mut self, callee: DefId)

Source

pub(crate) fn record_opaque_control_flow(&mut self, operation: &str)

Source

pub(crate) fn enter_frame( &mut self, callee: DefId, body: Option<&'tcx Body<'tcx>>, ) -> FrameState<'tcx>

Capture the frame-scoped state before switching to an inlined callee.

This is the single source of truth for what is frame-scoped: the whole FrameState (function identity, local bindings, and operand sources). Both inline mechanisms (handle_callee_entry in path replay and exec_inline_call) call this, so they can no longer drift apart.

Source

pub(crate) fn restore_frame(&mut self, frame: FrameState<'tcx>)

Restore the frame-scoped state after an inlined callee returns.

Source

pub(crate) fn local_value(&self, local: Local) -> Option<&VmValue<'z3, 'tcx>>

Look up the whole value bound to a MIR local (its path == [] slot in the allocation backing the local).

Source

pub(crate) fn term_involves( terms: &FxHashSet<Int<'z3>>, term: &Int<'z3>, ) -> bool

Source

pub(crate) fn set_local(&mut self, local: Local, value: VmValue<'z3, 'tcx>)

Bind a whole value to a MIR local (store it at path == [] in the allocation backing the local, allocating that stack slot on demand).

Source

pub(crate) fn invalidate_indexed_array(&mut self, local: Local)

Source

pub(crate) fn mark_initialized(&mut self, value: &mut VmValue<'z3, 'tcx>)

Mark a value as initialized (written), and sync its backing allocation’s ContentFacts::initialized fact.

This is the single entry point that keeps the value-level ValueFacts::init and the allocation-level ContentFacts::initialized in sync; callers must set the pair through here rather than by hand so the two facts cannot drift apart.

Source

pub(crate) fn local_address(&mut self, local: Local) -> Int<'z3>

Get the symbolic address of a MIR local (its stack allocation’s base).

Source

pub(crate) fn allocate( &mut self, size: Int<'z3>, align: Int<'z3>, element_ty: Option<Ty<'tcx>>, ) -> (AllocId, Int<'z3>)

Allocate a fresh symbolic object and return its ID and base address.

Source

pub(crate) fn allocate_external( &mut self, size: Int<'z3>, align: Int<'z3>, element_ty: Option<Ty<'tcx>>, ) -> (AllocId, Int<'z3>)

Allocate a fresh external allocation (for raw-pointer parameters). External allocations may be null and have unlimited size.

Source

pub(crate) fn allocate_slice( &mut self, len: Int<'z3>, elem_size: Int<'z3>, align: Int<'z3>, element_ty: Option<Ty<'tcx>>, ) -> (AllocId, Int<'z3>)

Allocate a slice/array data allocation with a known (possibly symbolic) element count. Computes size = len * elem_size and materializes len in one step, so size and the slice length can never diverge (the size == len * elem_size invariant is established here instead of being re-derived by every caller).

Source

fn allocate_internal( &mut self, size: Int<'z3>, align: Int<'z3>, element_ty: Option<Ty<'tcx>>, kind: AllocKind<'z3>, ) -> (AllocId, Int<'z3>)

Source

pub(crate) fn alloc(&self, id: AllocId) -> &Allocation<'z3, 'tcx>

Indexed access to an allocation by its AllocId (the id is the index).

Source

pub(crate) fn alloc_mut(&mut self, id: AllocId) -> &mut Allocation<'z3, 'tcx>

Mutable indexed access to an allocation by its AllocId.

Source

pub(crate) fn content(&self, id: AllocId) -> &MemoryContent<'z3, 'tcx>

Indexed access to an allocation’s contents by its AllocId.

Source

pub(crate) fn content_mut( &mut self, id: AllocId, ) -> &mut MemoryContent<'z3, 'tcx>

Mutable indexed access to an allocation’s contents by its AllocId.

Source

pub(crate) fn is_cstr_trusted(&self, id: AllocId) -> bool

Whether id was asserted a valid C string via a ValidCStr contract fact / struct invariant.

Source

pub(crate) fn is_utf8_trusted(&self, id: AllocId) -> bool

Whether id was asserted valid UTF-8 via a ValidString contract fact.

Source

pub(crate) fn root_alloc(&self, id: AllocId) -> AllocId

The ultimate root allocation, following parent chains (sub-allocations created by from_raw_parts / split_at / as_chunks, whose parent points at the allocation they were split from).

Source

pub(crate) fn fresh_int(&self, prefix: &str) -> Int<'z3>

Create a fresh symbolic Z3 int constant (globally unique, even across calls with the same prefix — Z3_mk_fresh_const auto-suffixes the name).

Source

pub(crate) fn field_value( &self, local: Local, path: &[usize], ) -> Option<&VmValue<'z3, 'tcx>>

Get the value of a specific field within an aggregate local.

Field values live in the allocation backing the local (the memory-contents layer MemoryContent::values), keyed by the local’s declared type as the view type. Returns None if the local has no allocation (the field was never materialized).

Source

pub(crate) fn field_paths(&self, local: Local) -> Vec<Vec<usize>>

Enumerate the field paths materialized for a local: every non-empty path for which Self::field_value currently returns a value (the local’s allocation’s fields under its declared view type). The whole value (path == []) is deliberately excluded — it is read via Self::local_value, not as a “field”, so callers iterating fields do not accidentally treat the whole value as a field projection.

Source

pub(crate) fn frame_local_ty( &self, frame: &FrameState<'tcx>, local: Local, ) -> Ty<'tcx>

The declared type of local in frame’s body.

Source

pub(crate) fn frame_field_paths( &self, frame: &FrameState<'tcx>, local: Local, ) -> Vec<Vec<usize>>

Enumerate the field paths materialized for local in a saved caller frame. Field values live in the path-scoped MemoryContent::values, so they are read via frame’s local_alloc and declared type.

Source

pub(crate) fn frame_field_value( &self, frame: &FrameState<'tcx>, local: Local, path: &[usize], ) -> Option<&VmValue<'z3, 'tcx>>

Read a field of local in a saved caller frame.

Source

pub(crate) fn frame_local_value( &self, frame: &FrameState<'tcx>, local: Local, ) -> Option<&VmValue<'z3, 'tcx>>

Read the whole value of local in a saved caller frame (its path == [] slot). The value lives in the path-scoped MemoryContent::values, while the name → allocation binding lives in the saved frame.

Source

pub(crate) fn all_local_values(&self) -> Vec<(Local, &VmValue<'z3, 'tcx>)>

Enumerate (local, whole value) for every local with a materialized whole value (its path == [] slot). This is the whole-value counterpart to Self::field_paths, used where code used to iterate locals.

Source

pub(crate) fn owner_ptr_field( &self, local: Local, ) -> Option<&VmValue<'z3, 'tcx>>

The field carrying an owned value’s heap pointer (Box/Vec/String’s owning pointer field), located generically via Self::container_ptr_field (e.g. Box → [0, 0], Vec → [0, 0, 0]). Falls back to the first materialized field with heap provenance for owners whose deep NonNull leaf was not explicitly materialized (e.g. a Box produced by into_boxed_slice, which only records the whole value).

Source

pub(crate) fn invalidate_owner_field(&mut self, local: Local)

Invalidate local’s owner-field provenance (mark it moved-out after a whole-place move), so a later Owning check does not treat it as a second owner of the heap allocation it no longer owns.

Source

pub(crate) fn set_field_value( &mut self, local: Local, path: Vec<usize>, value: VmValue<'z3, 'tcx>, )

Set the value of a specific field within an aggregate local.

Ensures the local has a backing allocation, then stores into the memory-contents layer (MemoryContent::values) keyed by the local’s declared type as the view type.

Source

pub(crate) fn write_local_path( &mut self, local: Local, path: Vec<usize>, value: VmValue<'z3, 'tcx>, )

Source

pub(crate) fn invalidate_field_descendants( &mut self, local: Local, path: &[usize], )

Source

pub(crate) fn assert_all(&self, solver: &Solver<'z3>)

Assert path conditions and invariant constraints into a solver.

Source

pub(crate) fn assert_path_constraints(&self, solver: &Solver<'z3>)

Source

fn assert_value_constraints( &self, solver: &Solver<'z3>, value: &VmValue<'z3, 'tcx>, )

Assert a single symbolic value’s known invariant constraints.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn indexed_element_target( &self, place: &Place<'tcx>, ) -> Option<(AllocId, Int<'z3>)>

Source

pub(crate) fn store_indexed_element( &mut self, alloc_id: AllocId, index: Int<'z3>, value: VmValue<'z3, 'tcx>, )

Source

pub(crate) fn store_repeated_indexed_elements( &mut self, alloc_id: AllocId, base: Int<'z3>, count: u64, value: VmValue<'z3, 'tcx>, )

Source

pub(crate) fn path_implies(&self, condition: &Bool<'z3>) -> bool

Source

fn stored_indexed_element( &self, place: &Place<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>

Source

pub(crate) fn symbolic_const_term(&self, constant: &Const<'tcx>) -> Int<'z3>

Source

pub(crate) fn symbolic_const_term_text(&self, text: &str) -> Int<'z3>

Source

pub(crate) fn const_param_term(&self, index: u32) -> Option<Int<'z3>>

Source

pub(crate) fn value_of_operand( &self, operand: &Operand<'tcx>, ) -> VmValue<'z3, 'tcx>

Extract a VmValue from a MIR operand.

Source

pub(crate) fn materialize_const_adt( &mut self, local: Local, constant: &Const<'tcx>, )

Source

fn const_field_term(&self, val: &ConstValue, ty: Ty<'tcx>) -> Int<'z3>

Source

fn byte_from_field( &self, alloc_id: AllocId, ty: Ty<'tcx>, offset: usize, ) -> Option<Int<'z3>>

Read the byte at offset within a repr(C)-style ADT from its materialized scalar field values — the field→byte direction of the cast cross-view materialization. Returns None when offset does not land inside a concrete scalar field (so the caller falls back to the base).

Source

pub(crate) fn value_of_place( &self, place: &Place<'tcx>, ) -> Option<VmValue<'z3, 'tcx>>

Look up the value stored at a MIR place.

Source

fn is_len_field_read(&self, ty: Ty<'tcx>, field_path: &[usize]) -> bool

Whether field_path selects a length field.

Source

pub(super) fn is_cap_field_read( &self, ty: Ty<'tcx>, field_path: &[usize], ) -> bool

Source

pub(crate) fn unknown_value_for_place( &self, place: &Place<'tcx>, ) -> VmValue<'z3, 'tcx>

Create an unknown value for a place.

The value carries no non_null (or any other) assumption: a raw pointer whose provenance was lost may still be null, so assuming non-null here would let NonNull/null-guard checks pass unsoundly.

Source§

impl<'z3, 'tcx> VmExecutor<'z3, 'tcx>

Source

pub(crate) fn has_alias_hazard(&self, alloc_id: AllocId) -> bool

Whether a declared alias contract accepts this allocation’s root.

Source

pub(crate) fn new( z3_ctx: &'z3 Context, tcx: TyCtxt<'tcx>, target_def_id: DefId, instantiated_target_body: Option<&'tcx Body<'tcx>>, constructor_mir_mode: ConstructorMirMode, ) -> Self

Create an executor with fresh state for one path.

Trait Implementations§

Source§

impl<'z3, 'tcx> Clone for VmExecutor<'z3, 'tcx>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for VmExecutor<'_, '_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'z3, 'tcx> !DynSend for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> !DynSync for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> !Freeze for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> !RefUnwindSafe for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> !Send for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> !Sync for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> !UnwindSafe for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> Forget for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> Move for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> Unpin for VmExecutor<'z3, 'tcx>

§

impl<'z3, 'tcx> UnsafeUnpin for VmExecutor<'z3, 'tcx>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V