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_offsetand*mut T::align_offsetfor 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 thanusize::MAXalignsptr + offset * size_of::<T>(). Modeling the bitwise operations exactly also makes branch solving time out. - is_
box_ new - Identify standard
Box::newandBox::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, andManuallyDrop::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::dropso verification and slicing preserve its explicit lifetime-ending effect. - is_
nonnull_ dangling - Identify
NonNull::danglingfor its constructor summary when MIR expansion is disabled. Unlike an arbitraryNonNull<T>, its result is aligned forTand 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.