Skip to main content

Module builtin_models

Module builtin_models 

Source
Expand description

Builtin call models: API behaviour modelling when MIR is unavailable.

Each recognised standard-library API is described by a single table row: a matcher (from crate::verify::api_classify) and an effect builder. lookup_effect scans the table linearly (first match wins) and converts the matched row into the effect summary consumed by the VM; is_modeled reports whether a call is in the table (used by the path graph to keep modelled calls opaque instead of inlining their branchy CFG).

Two layers:

  1. Matchers โ€” crate::verify::api_classify DefId classifiers.
  2. Effect functions โ€” produce the Vec<CallEffect> for a single API.

Macrosยง

ED ๐Ÿ”’
DefId-based matcher row (fn(Option<DefId>) -> bool).

Structsยง

EffCtx ๐Ÿ”’
Entry ๐Ÿ”’

Enumsยง

PtrDirection ๐Ÿ”’
PtrGranularity ๐Ÿ”’

Staticsยง

REGISTRY ๐Ÿ”’

Functionsยง

dest_is_pointer ๐Ÿ”’
eff_alias_arg0 ๐Ÿ”’
eff_alias_ptr ๐Ÿ”’
eff_align_offset ๐Ÿ”’
eff_align_to ๐Ÿ”’
eff_box_alloc ๐Ÿ”’
eff_box_from_vec ๐Ÿ”’
eff_cmp_min ๐Ÿ”’
eff_drop_memory ๐Ÿ”’
eff_exchange_malloc ๐Ÿ”’
eff_from_raw_parts ๐Ÿ”’
eff_layout_align ๐Ÿ”’
eff_layout_const ๐Ÿ”’
eff_len ๐Ÿ”’
eff_mem_replace ๐Ÿ”’
eff_new_allocation ๐Ÿ”’
eff_new_allocation_from_cap ๐Ÿ”’
eff_new_unchecked ๐Ÿ”’
NonNull::new_unchecked(ptr): a transparent re-wrap that preserves ptrโ€™s value and provenance (element offset included), inheriting non-nullness from the source rather than asserting it.
eff_none ๐Ÿ”’
eff_option_scan_index ๐Ÿ”’
eff_overflowing_nz ๐Ÿ”’
eff_ownership_recon ๐Ÿ”’
eff_ptr_add ๐Ÿ”’
eff_ptr_add_byte ๐Ÿ”’
eff_ptr_arith ๐Ÿ”’
Shared model for ReturnPointerAdd/ReturnPointerSub.
eff_ptr_sub ๐Ÿ”’
eff_ptr_sub_byte ๐Ÿ”’
eff_return_abs ๐Ÿ”’
eff_return_add ๐Ÿ”’
eff_return_clamp ๐Ÿ”’
eff_return_max ๐Ÿ”’
eff_return_mul ๐Ÿ”’
eff_return_neg ๐Ÿ”’
eff_return_nonzero_iff ๐Ÿ”’
eff_return_option_some_add ๐Ÿ”’
eff_return_option_some_mul ๐Ÿ”’
eff_return_option_some_nonzero ๐Ÿ”’
eff_return_option_some_nonzero_iff ๐Ÿ”’
eff_scan_length ๐Ÿ”’
eff_select_unpredictable ๐Ÿ”’
eff_slice_range ๐Ÿ”’
eff_sliceindex_get_unchecked ๐Ÿ”’
SliceIndex::get_unchecked(self, slice) / get_unchecked_mut: returns an element pointer at slice + self (receiver is the index, slice pointer is argument 1). Element-strided add off argument 1, inheriting non-nullness from the slice.
eff_split_at ๐Ÿ”’
eff_vec_from_box ๐Ÿ”’
eff_write_mem ๐Ÿ”’
is_modeled ๐Ÿ”’
True when callee matches a hand-modelled API in the registry. The path graph uses this to keep such calls opaque (it must not inline their branchy CFG when the VM models their semantics more precisely).
layout_call_ty ๐Ÿ”’
layout_constant_effect ๐Ÿ”’
lookup_effect ๐Ÿ”’