Skip to main content

Module handle_placeholders

Module handle_placeholders 

Source
Expand description

Logic for lowering higher-kinded outlives constraints (with placeholders and universes) and turn them into regular outlives constraints.

Re-exportsΒ§

use rustc_data_structures::frozen::Frozen; πŸ”’
use rustc_data_structures::fx::FxIndexMap; πŸ”’
use rustc_data_structures::graph::scc; πŸ”’
use rustc_data_structures::graph::scc::Sccs; πŸ”’
use rustc_index::IndexVec; πŸ”’
use rustc_infer::infer::RegionVariableOrigin; πŸ”’
use rustc_middle::mir::ConstraintCategory; πŸ”’
use rustc_middle::ty::RegionVid; πŸ”’
use rustc_middle::ty::UniverseIndex; πŸ”’
use tracing::debug; πŸ”’
use tracing::trace; πŸ”’
use crate::constraints::ConstraintSccIndex; πŸ”’
use crate::constraints::OutlivesConstraintSet; πŸ”’
use crate::consumers::OutlivesConstraint; πŸ”’
use crate::diagnostics::UniverseInfo; πŸ”’
use crate::region_infer::values::LivenessValues; πŸ”’
use crate::region_infer::values::PlaceholderIndices; πŸ”’
use crate::region_infer::ConstraintSccs; πŸ”’
use crate::region_infer::RegionDefinition; πŸ”’
use crate::region_infer::Representative; πŸ”’
use crate::region_infer::TypeTest; πŸ”’
use crate::ty::VarianceDiagInfo; πŸ”’
use crate::type_check::free_region_relations::UniversalRegionRelations; πŸ”’
use crate::type_check::Locations; πŸ”’
use crate::type_check::MirTypeckRegionConstraints; πŸ”’
use crate::universal_regions::UniversalRegions; πŸ”’
use crate::BorrowckInferCtxt; πŸ”’
use crate::NllRegionVariableOrigin; πŸ”’

StructsΒ§

LoweredConstraints πŸ”’
A set of outlives constraints after rewriting to remove higher-kinded constraints.
PlaceholderReachability πŸ”’
RegionTracker πŸ”’
An annotation for region graph SCCs that tracks the values of its elements. This annotates a single SCC.
SccAnnotations πŸ”’
A Visitor for SCC annotation construction.

FunctionsΒ§

compute_sccs_applying_placeholder_outlives_constraints πŸ”’
This method handles placeholders by rewriting the constraint graph. For each strongly connected component in the constraint graph such that there is a series of constraints A: B: C: … : X where A contains a placeholder whose universe cannot be named by X, add a constraint that X: ’static. This is a safe upper bound in the face of borrow checker/trait solver limitations that will eventually go away.
region_definitions πŸ”’
Determines if the region variable definitions contain placeholders, and compute them for later use.
rewrite_placeholder_outlives πŸ”’