Module rustc_mir::borrow_check::nll::region_infer[][src]

🔬 This is a nightly-only experimental API. (rustc_private)

this crate is being loaded from the sysroot, an unstable location; did you mean to load this crate from crates.io via Cargo.toml instead?

Re-exports

use super::universal_regions::UniversalRegions;
use rustc::hir::def_id::DefId;
use rustc::infer::InferCtxt;
use rustc::infer::NLLRegionVariableOrigin;
use rustc::infer::RegionObligation;
use rustc::infer::RegionVariableOrigin;
use rustc::infer::SubregionOrigin;
use rustc::infer::error_reporting::nice_region_error::NiceRegionError;
use rustc::infer::region_constraints::GenericKind;
use rustc::infer::region_constraints::VarInfos;
use rustc::mir::ClosureOutlivesRequirement;
use rustc::mir::ClosureOutlivesSubject;
use rustc::mir::ClosureRegionRequirements;
use rustc::mir::Local;
use rustc::mir::Location;
use rustc::mir::Mir;
use rustc::traits::ObligationCause;
use rustc::ty;
use rustc::ty::RegionVid;
use rustc::ty::Ty;
use rustc::ty::TypeFoldable;
use rustc::util::common;
use rustc::util::common::ErrorReported;
use rustc_data_structures::bitvec::BitVector;
use rustc_data_structures::indexed_vec::Idx;
use rustc_data_structures::indexed_vec::IndexVec;
use std::fmt;
use std::rc::Rc;
use syntax::ast;
use syntax_pos::Span;
use self::dfs::CopyFromSourceToTarget;
use self::dfs::TestTargetOutlivesSource;
use self::values::RegionValueElements;
use self::values::RegionValues;
use super::ToRegionVid;

Modules

annotation [
Experimental
]

As part of the NLL unit tests, you can annotate a function with #[rustc_regions], and we will emit information about the region inference context and -- in particular -- the external constraints that this region imposes on others. The methods in this file handle the part about dumping the inference context internal state.

dfs [
Experimental
]

Module defining the dfs method on RegionInferenceContext, along with its associated helper traits.

dump_mir [
Experimental
]

As part of generating the regions, if you enable -Zdump-mir=nll, we will generate an annotated copy of the MIR that includes the state of region inference. This code handles emitting the region context internal state.

graphviz [
Experimental
]

This module provides linkage between RegionInferenceContext and libgraphviz traits, specialized to attaching borrowck analysis data to rendered labels.

values [
Experimental
]

Structs

Constraint [
Experimental
]
ConstraintIndex [
Experimental
]
RegionCausalInfo [
Experimental
]
RegionDefinition [
Experimental
]
RegionInferenceContext [
Experimental
]
TrackCauses [
Experimental
]
TypeTest [
Experimental
]

A "type test" corresponds to an outlives constraint between a type and a lifetime, like T: 'x or <T as Foo>::Bar: 'x. They are translated from the Verify region constraints in the ordinary inference context.

Enums

Cause [
Experimental
]

NB: The variants in Cause are intentionally ordered. Lower values are preferred when it comes to error messages. Do not reorder willy nilly.

RegionTest [
Experimental
]

A "test" that can be applied to some "subject region" 'x. These are used to describe type constraints. Tests do not presently affect the region values that get inferred for each variable; they only examine the results after inference. This means they can conveniently include disjuction ("a or b must be true").

Traits

CauseExt [
Experimental
]
ClosureRegionRequirementsExt [
Experimental
]