[][src]Module rustc::infer

⚙️ This is an internal compiler API. (rustc_private)

This crate is being loaded from the sysroot, a permanently unstable location for private compiler dependencies. It is not intended for general use. Prefer using a public version of this crate from crates.io via Cargo.toml.

See the Book for more information.

Re-exports

pub use self::LateBoundRegionConversionTime::*;
pub use self::RegionVariableOrigin::*;
pub use self::SubregionOrigin::*;
pub use self::ValuePairs::*;
pub use crate::ty::IntVarValue;

Modules

atInternal

A nice interface for working with the infcx. The basic idea is to do infcx.at(cause, param_env), which sets the "cause" of the operation as well as the surrounding parameter environment. Then you can do something like .sub(a, b) or .eq(a, b) to create a subtype or equality relationship respectively. The first argument is always the "expected" output from the POV of diagnostics.

canonicalInternal

Canonicalization is the key to constructing a query in the middle of type inference. Ordinarily, it is not possible to store types from type inference in query keys, because they contain references to inference variables whose lifetimes are too short and so forth. Canonicalizing a value T1 using canonicalize_query produces two things:

combineInternal
equateInternal
error_reportingInternal

Error Reporting Code for the inference engine

freshenInternal

Freshening is the process of replacing unknown variables with fresh types. The idea is that the type, after freshening, contains no inference variables but instead contains either a value for each variable or fresh "arbitrary" types wherever a variable would have been.

fudgeInternal
glbInternal
higher_rankedInternal

Helper routines for higher-ranked things. See the doc module at the end of the file for details.

latticeInternal

Lattice Variables

lexical_region_resolveInternal

Lexical region resolution.

lubInternal
nll_relateInternal

This code is kind of an alternate way of doing subtyping, supertyping, and type equating, distinct from the combine.rs code but very similar in its effect and design. Eventually the two ought to be merged. This code is intended for use in NLL and chalk.

opaque_typesInternal
outlivesInternal

Various code related to computing outlives relations.

region_constraintsInternal

See README.md.

resolveInternal
subInternal
type_variableInternal
unify_keyInternal

Structs

CombinedSnapshotInternal
InferCtxtInternal
InferCtxtBuilderInternal

Helper type of a temporary returned by tcx.infer_ctxt(). Necessary because we can't write the following bound: F: for<'b, 'tcx> where 'tcx FnOnce(InferCtxt<'b, 'tcx>).

InferOkInternal
RegionObligationInternal

See the region_obligations field for more information.

ShallowResolverInternal
SuppressRegionErrorsInternal

A flag that is used to suppress region errors. This is normally false, but sometimes -- when we are doing region checks that the NLL borrow checker will also do -- it might be set to true.

TypeFreshenerInternal
TypeTraceInternal

The trace designates the path through inference that we took to encounter an error or subtyping constraint.

Enums

FixupErrorInternal
LateBoundRegionConversionTimeInternal

Times when we replace late-bound regions with variables:

NLLRegionVariableOriginInternal
ParameterOriginInternal

Places that type/region parameters can appear.

RegionVariableOriginInternal

Reasons to create a region inference variable

SubregionOriginInternal

The origin of a r1 <= r2 constraint.

ValuePairsInternal

See the error_reporting module for more details.

Constants

_Internal

Type Definitions

BoundInternal
FixupResultInternal
InferResultInternal
PlaceholderMapInternal

A map returned by replace_bound_vars_with_placeholders() indicating the placeholder region that each late-bound region was replaced with.

UnitResultInternal