Expand description
Verification checkpoint types and their MIR collection.
A Checkpoint is a point in a function body that must be verified: an
unsafe call, a MIR intrinsic, a raw-pointer dereference, or a static mut access. The
collect_* functions scan MIR and attach safety requirements; the rest of
the verifier consumes the resulting records.
Re-exportsΒ§
use crate::def_ids::intrinsic_api;πuse crate::util::mir_scan::get_fn_safety;πuse crate::util::mir_scan::place_has_raw_deref;πuse crate::util::mir_utils::pointee_ty;πuse crate::util::name::get_cleaned_def_path_name;πuse rustc_hir::def_id::DefId;πuse rustc_hir::Safety;πuse rustc_middle::mir::BasicBlock;πuse rustc_middle::mir::Body;πuse rustc_middle::mir::Local;πuse rustc_middle::mir::NonDivergingIntrinsic;πuse rustc_middle::mir::Operand;πuse rustc_middle::mir::Place;πuse rustc_middle::mir::ProjectionElem;πuse rustc_middle::mir::Rvalue;πuse rustc_middle::mir::StatementKind;πuse rustc_middle::mir::TerminatorKind;πuse rustc_middle::ty;πuse rustc_middle::ty::List;πuse rustc_middle::ty::Ty;πuse rustc_middle::ty::TyCtxt;πuse rustc_middle::mir::CastKind;πuse std::collections::HashSet;πuse crate::contract::ContractExpr;πuse crate::contract::ContractKind;πuse crate::contract::ContractPlace;πuse crate::contract::PlaceBase;πuse crate::contract::Property;πuse crate::contract::PropertyArg;πuse crate::contract::PropertyKind;π
StructsΒ§
- Checkpoint π
- A point in a functionβs MIR whose safety requirements are checked.
- Checkpoint
Location - MIR block containing a verification checkpoint.
EnumsΒ§
- Checkpoint
Kind - Kind of an unsafe verification checkpoint inside a function body.
- RawPtr
Access π
FunctionsΒ§
- box_
deref_ πtransmute_ locals - Locals that hold the result of the compilerβs safe
*boxderef lowering (directly, or through copies and pointer casts). The compiler lowers*boxto a raw-pointer deref of a pointer produced by casting the boxβs inner field to a raw pointer, and that deref is safe by theBoxinvariant, so it is not a raw-pointer-deref checkpoint. - collect_
raw_ ptr_ deref_ checkpoints - Collect raw pointer dereferences and their safety requirements.
- collect_
static_ mut_ checkpoints - Collect checkpoints for mutable static accesses in
def_id. - collect_
unsafe_ callsites - Collect unsafe calls in
def_idβs optimized MIR as verification checkpoints. - is_
box_ πderef_ cast - Whether
rvalueis the compilerβs lowering of the safe*boxderef. - ptr_
operand_ πfor_ deref_ place - Extract the pointer operand from a dereference place.
- raw_
ptr_ πderef_ requirements - static_
mut_ πcheckpoint