Skip to main content

Module pointer_semantics

Module pointer_semantics 

Source
Expand description

VM rules for pointer-preserving calls and owner lifetimes.

Re-exportsยง

use std::collections::HashMap; ๐Ÿ”’
use rustc_hir::def_id::DefId; ๐Ÿ”’
use rustc_middle::mir::Body; ๐Ÿ”’
use rustc_middle::mir::Operand; ๐Ÿ”’
use rustc_middle::mir::ProjectionElem; ๐Ÿ”’
use rustc_middle::mir::StatementKind; ๐Ÿ”’
use rustc_middle::mir::TerminatorKind; ๐Ÿ”’
use rustc_middle::ty::Ty; ๐Ÿ”’
use rustc_middle::ty::TyCtxt; ๐Ÿ”’
use rustc_middle::ty::TyKind; ๐Ÿ”’
use crate::analysis::dataflow::pointer_flow::is_nonnull_view; ๐Ÿ”’
use crate::analysis::dataflow::pointer_flow::return_source_arg; ๐Ÿ”’
use crate::util::mir_utils; ๐Ÿ”’

Functionsยง

callsite_replaces_pointer_field ๐Ÿ”’
Whether a callee can replace a pointer stored in one of its objects. This follows MIR calls rather than identifying container methods by name.
is_benign_origin_use ๐Ÿ”’
Whether MIR shows a read-only pointer view of the first argument.
is_pointer_storage_ty ๐Ÿ”’
is_read_only_nonnull_view ๐Ÿ”’
A NonNull view that leaves its input allocation unchanged.
is_read_only_return ๐Ÿ”’
A pointer result from a single, side-effect-free MIR block is safe to use while tracking an existing pointer origin.
replaces_pointer_field_rec ๐Ÿ”’
returns_undropped_arg ๐Ÿ”’
A consumed owner remains allocated when a side-effect-free MIR body returns its pointer without running a destructor.
single_block_without_effects ๐Ÿ”’
A single return block with no writes through a dereferenced place.