Skip to main content

Module mir_scan

Module mir_scan 

Source

Re-exportsΒ§

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; πŸ”’

FunctionsΒ§

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.