Skip to main content

Module legacy

Module legacy 

Source
Expand description

Functions dedicated to fact generation for the -Zpolonius=legacy datalog implementation.

Will be removed in the future, once the in-tree -Zpolonius=next implementation reaches feature parity.

Re-exportsΒ§

use std::iter; πŸ”’
use either::Either; πŸ”’
use rustc_middle::mir::Body; πŸ”’
use rustc_middle::mir::Local; πŸ”’
use rustc_middle::mir::LocalKind; πŸ”’
use rustc_middle::mir::Location; πŸ”’
use rustc_middle::ty::GenericArg; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_mir_dataflow::move_paths::InitKind; πŸ”’
use rustc_mir_dataflow::move_paths::InitLocation; πŸ”’
use rustc_mir_dataflow::move_paths::MoveData; πŸ”’
use tracing::debug; πŸ”’
use crate::borrow_set::BorrowSet; πŸ”’
use crate::constraints::OutlivesConstraint; πŸ”’
use crate::handle_placeholders::LoweredConstraints; πŸ”’
use crate::type_check::free_region_relations::UniversalRegionRelations; πŸ”’
use crate::universal_regions::UniversalRegions; πŸ”’

ModulesΒ§

accesses πŸ”’
facts πŸ”’
loan_invalidations πŸ”’
loan_kills πŸ”’
location πŸ”’

StructsΒ§

FactWriter
LocationIndex
PoloniusLocationTable
Maps between a MIR Location, which identifies a particular statement within a basic block, to a β€œrich location”, which identifies at a finer granularity. In particular, we distinguish the start of a statement and the mid-point. The mid-point is the point just before the statement takes effect; in particular, for an assignment A = B, it is the point where B is about to be written into A. This mid-point is a kind of hack to work around our inability to track the position information at sufficient granularity through outlives relations; however, the rich location table serves another purpose: it compresses locations from multiple words into a single u32.
PoloniusRegionVid
A (kinda) newtype of RegionVid so we can implement Atom on it.
RustcFacts

EnumsΒ§

RichLocation

TraitsΒ§

FactCell
FactRow
PoloniusFactsExt

FunctionsΒ§

emit_drop_facts πŸ”’
For every potentially drop()-touched region region in local’s type (kind), emit a drop_of_var_derefs_origin(local, origin) fact.
emit_facts πŸ”’
When requested, emit most of the facts needed by polonius:
emit_move_facts πŸ”’
Emit facts needed for move/init analysis: moves and assignments.
emit_outlives_facts πŸ”’
Emit facts about the outlives constraints: the subset base relation, i.e. not a transitive closure.
emit_universal_region_facts πŸ”’
Emit universal regions facts, and their relations.
write_row

Type AliasesΒ§

PoloniusFacts
PoloniusOutput