Skip to main content

Module universal_regions

Module universal_regions 

Source
Expand description

Code to extract the universally quantified regions declared on a function. For example:

fn foo<'a, 'b, 'c: 'b>() { }

here we would return a map assigning each of {'a, 'b, 'c} to an index.

The code in this file doesn’t do anything with those results; it just returns them for other code to use.

Re-exportsΒ§

use std::cell::Cell; πŸ”’
use std::iter; πŸ”’
use rustc_attr_ir::lang_items::LangItem; πŸ”’
use rustc_data_structures::fx::FxIndexMap; πŸ”’
use rustc_errors::Diag; πŸ”’
use rustc_hir::BodyOwnerKind; πŸ”’
use rustc_hir::def::DefKind; πŸ”’
use rustc_hir::def_id::DefId; πŸ”’
use rustc_hir::def_id::LocalDefId; πŸ”’
use rustc_index::IndexVec; πŸ”’
use rustc_infer::infer::NllRegionVariableOrigin; πŸ”’
use rustc_macros::extension; πŸ”’
use rustc_middle::mir::RETURN_PLACE; πŸ”’
use rustc_middle::ty::print::with_no_trimmed_paths; πŸ”’
use rustc_middle::ty::print::with_no_trimmed_paths; πŸ”’
use rustc_middle::ty; πŸ”’
use rustc_middle::ty::BoundVariableKind; πŸ”’
use rustc_middle::ty::GenericArgs; πŸ”’
use rustc_middle::ty::InlineConstArgs; πŸ”’
use rustc_middle::ty::InlineConstArgsParts; πŸ”’
use rustc_middle::ty::List; πŸ”’
use rustc_middle::ty::RegionVid; πŸ”’
use rustc_middle::ty::Ty; πŸ”’
use rustc_middle::ty::TyCtxt; πŸ”’
use rustc_middle::ty::TypeFoldable; πŸ”’
use rustc_middle::ty::TypeVisitableExt; πŸ”’
use rustc_middle::ty::fold_regions; πŸ”’
use rustc_span::ErrorGuaranteed; πŸ”’
use rustc_span::bug; πŸ”’
use rustc_span::kw; πŸ”’
use rustc_span::span_bug; πŸ”’
use rustc_span::sym; πŸ”’
use tracing::debug; πŸ”’
use tracing::instrument; πŸ”’
use tracing::instrument; πŸ”’
use crate::BorrowckInferCtxt; πŸ”’
use crate::renumber::RegionCtxt; πŸ”’

StructsΒ§

UniversalRegionIndices πŸ”’
UniversalRegions πŸ”’
UniversalRegionsBuilder πŸ”’

EnumsΒ§

DefiningTy πŸ”’
The β€œdefining type” for this MIR. The key feature of the β€œdefining type” is that it contains the information needed to derive all the universal regions that are in scope as well as the types of the inputs/output from the MIR. In general, early-bound universal regions appear free in the defining type and late-bound regions appear bound in the signature.
RegionClassification πŸ”’

ConstantsΒ§

FIRST_GLOBAL_INDEX πŸ”’

TraitsΒ§

InferCtxtExt πŸ”’

FunctionsΒ§

for_each_late_bound_region_in_item πŸ”’
Iterates over the late-bound regions defined on mir_def_id and all of its parents, up to the typeck root, and invokes f with the liberated form of each one.
for_each_late_bound_region_in_recursive_scope πŸ”’
Iterates over the late-bound regions defined on mir_def_id and all of its parents, up to the typeck root, and invokes f with the liberated form of each one.