Skip to main contentModule mir_scan
Source use rustc_hir::Safety; π use rustc_hir::def_id::DefId; π use rustc_middle::mir::Body; π use rustc_middle::mir::Local; π 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::TyCtxt; π use rustc_middle::ty::TyKind; π use std::collections::HashMap; π use std::collections::HashSet; π use super::mir_utils::dep_callee_def_id; π
- collect_global_local_pairs
- Collects pairs of global static variables and their corresponding local variables
within a functionβs MIR that are assigned from statics.
- get_fn_safety
- Returns the [
Safety] (Safe/Unsafe) of a functionβs signature. - get_rawptr_deref
- Analyzes the MIR of the given function to collect all local variables
that are involved in dereferencing raw pointers (
*const T or *mut T). - get_unsafe_callees
- Scans MIR for calls to unsafe functions and returns the set of callee DefIds.
- place_has_raw_deref π
- Helper checking if a [
Place] involves raw pointer dereference.