Skip to main content

Module checkpoint

Module checkpoint 

Source
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.
CheckpointLocation
MIR block containing a verification checkpoint.

EnumsΒ§

CheckpointKind
Kind of an unsafe verification checkpoint inside a function body.
RawPtrAccess πŸ”’

FunctionsΒ§

box_deref_transmute_locals πŸ”’
Locals that hold the result of the compiler’s safe *box deref lowering (directly, or through copies and pointer casts). The compiler lowers *box to 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 the Box invariant, 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 rvalue is the compiler’s lowering of the safe *box deref.
ptr_operand_for_deref_place πŸ”’
Extract the pointer operand from a dereference place.
raw_ptr_deref_requirements πŸ”’
static_mut_checkpoint πŸ”’