Skip to main content

Module other_api

Module other_api 

Source
Expand description

Identify core, alloc, and std APIs without depending on MIR availability. Callers use these identities to avoid costly MIR expansion where a summary exists, and to preserve facts needed by verification and slicing.

ยงAgent Rules

Keep this module limited to API identity checks based on compiler metadata, types, signatures, or standard-library paths. Do not depend on RAPx modules outside def_ids or implement call semantics here.

Re-exportsยง

use rustc_hir::def_id::DefId; ๐Ÿ”’
use rustc_middle::ty::TyCtxt; ๐Ÿ”’
use rustc_middle::ty::TyKind; ๐Ÿ”’
use rustc_middle::ty::UintTy; ๐Ÿ”’
use crate::def_ids::lang_api; ๐Ÿ”’
use super::diagnostic_api; ๐Ÿ”’
use super::is_std_api; ๐Ÿ”’
use super::type_ids; ๐Ÿ”’

Functionsยง

is_align_offset
Identify *const T::align_offset and *mut T::align_offset for their call effect, which takes priority over expanding their available MIR. Their internal helper has costly branches and symbolic bitwise arithmetic: expanding it is much slower, and the VM loses the guarantee that a result other than usize::MAX aligns ptr + offset * size_of::<T>(). Modeling the bitwise operations exactly also makes branch solving time out.
is_box_new
Identify standard Box::new and Box::new_in. Dependency slicing keeps all inputs, and constructor modeling avoids treating the input as a pre-existing raw owner pointer.
is_drop_fn
Identify drop, drop_in_place, and ManuallyDrop::drop. Slicing keeps these calls because they can end a valueโ€™s lifetime.
is_gcd
Identify the standard gcd called by slice alignmentโ€™s generic const block. Recursive expansion is costly, and CTFE leaves generic sizes symbolic; the VM uses this identity to retain the divisibility facts needed for proof.
is_manually_drop
Identify ManuallyDrop::drop so verification and slicing preserve its explicit lifetime-ending effect.
is_nonnull_dangling
Identify NonNull::dangling for its constructor summary when MIR expansion is disabled. Unlike an arbitrary NonNull<T>, its result is aligned for T and has no allocation provenance; the type invariant only guarantees non-nullness.
is_ub_check
Identify standard-library UB and precondition checks. The path builder skips their costly MIR, while the VM handles them as check calls.