Struct rustc::infer::InferCtxt [] [src]

pub struct InferCtxt<'a, 'gcx: 'a + 'tcx, 'tcx: 'a> {
    pub tcx: TyCtxt<'a, 'gcx, 'tcx>,
    pub in_progress_tables: Option<&'a RefCell<TypeckTables<'tcx>>>,
    pub projection_cache: RefCell<ProjectionCache<'tcx>>,
    pub type_variables: RefCell<TypeVariableTable<'tcx>>,
    pub selection_cache: SelectionCache<'tcx>,
    pub evaluation_cache: EvaluationCache<'tcx>,
    pub reported_trait_errors: RefCell<FxHashMap<Span, Vec<Predicate<'tcx>>>>,
    // some fields omitted
}
🔬 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?

Fields

🔬 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?

🔬 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?

During type-checking/inference of a body, in_progress_tables contains a reference to the tables being built up, which are used for reading closure kinds/signatures as they are inferred, and for error reporting logic to read arbitrary node types.

🔬 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?

🔬 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?

🔬 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?

Caches the results of trait selection. This cache is used for things that have to do with the parameters in scope.

🔬 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?

Caches the results of trait evaluation.

🔬 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?

Methods

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

impl<'infcx, 'gcx, 'tcx> InferCtxt<'infcx, 'gcx, 'tcx>
[src]

[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?

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

When given a ConcreteFailure for a function with arguments containing a named region and an anonymous region, emit an descriptive diagnostic error.

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

[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?

[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?

[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?

[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?

[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?

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

Print the error message for lifetime errors when both the concerned regions are anonymous.

Consider a case where we have

fn foo(x: &mut Vec<&u8>, y: &u8) {
    x.push(y);
}

The example gives

fn foo(x: &mut Vec<&u8>, y: &u8) {
                   ---      --- these references are declared with different lifetimes...
    x.push(y);
    ^ ...but data from `y` flows into `x` here

It has been extended for the case of structs too.

Consider the example

struct Ref<'a> { x: &'a u32 }
fn foo(mut x: Vec<Ref>, y: Ref) {
                  ---      --- these structs are declared with different lifetimes...
    x.push(y);
    ^ ...but data from `y` flows into `x` here
}
````

It will later be extended to trait objects.

[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?

This function calls the visit_ty method for the parameters corresponding to the anonymous regions. The nested_visitor.found_type contains the anonymous type.

Arguments

region - the anonymous region corresponding to the anon_anon conflict br - the bound region corresponding to the above region which is of type BrAnon(_)

Example

fn foo(x: &mut Vec<&u8>, y: &u8)
   { x.push(y); }

The function returns the nested type corresponding to the anonymous region for e.g. &u8 and Vec<&u8.

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

[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?

[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?

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

This rather funky routine is used while processing expected types. What happens here is that we want to propagate a coercion through the return type of a fn to its argument. Consider the type of Option::Some, which is basically for<T> fn(T) -> Option<T>. So if we have an expression Some(&[1, 2, 3]), and that has the expected type Option<&[u32]>, we would like to type check &[1, 2, 3] with the expectation of &[u32]. This will cause us to coerce from &[u32; 3] to &[u32] and make the users life more pleasant.

The way we do this is using fudge_regions_if_ok. What the routine actually does is to start a snapshot and execute the closure f. In our example above, what this closure will do is to unify the expectation (Option<&[u32]>) with the actual return type (Option<?T>, where ?T represents the variable instantiated for T). This will cause ?T to be unified with &?a [u32], where ?a is a fresh lifetime variable. The input type (?T) is then returned by f().

At this point, fudge_regions_if_ok will normalize all type variables, converting ?T to &?a [u32] and end the snapshot. The problem is that we can't just return this type out, because it references the region variable ?a, and that region variable was popped when we popped the snapshot.

So what we do is to keep a list (region_vars, in the code below) of region variables created during the snapshot (here, ?a). We fold the return value and replace any such regions with a new region variable (e.g., ?b) and return the result (&?b [u32]). This can then be used as the expectation for the fn argument.

The important point here is that, for soundness purposes, the regions in question are not particularly important. We will use the expected types to guide coercions, but we will still type-check the resulting types from those coercions against the actual types (?T, Option<?T) -- and remember that after the snapshot is popped, the variable ?T is no longer unified.

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

Replace all regions bound by binder with skolemized regions and return a map indicating which bound-region was replaced with what skolemized region. This is the first step of checking subtyping when higher-ranked things are involved.

Important: you must call this function from within a snapshot. Moreover, before committing the snapshot, you must eventually call either plug_leaks or pop_skolemized to remove the skolemized regions. If you rollback the snapshot (or are using a probe), then the pop occurs as part of the rollback, so an explicit call is not needed (but is also permitted).

See README.md for more details.

[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?

Searches the region constraints created since snapshot was started and checks to determine whether any of the skolemized regions created in skol_map would "escape" -- meaning that they are related to other regions in some way. If so, the higher-ranked subtyping doesn't hold. See README.md for more details.

[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?

This code converts from skolemized regions back to late-bound regions. It works by replacing each region in the taint set of a skolemized region with a bound-region. The bound region will be bound by the outer-most binder in value; the caller must ensure that there is such a binder and it is the right place.

This routine is only intended to be used when the leak-check has passed; currently, it's used in the trait matching code to create a set of nested obligations frmo an impl that matches against something higher-ranked. More details can be found in librustc/middle/traits/README.md.

As a brief example, consider the obligation for<'a> Fn(&'a int) -> &'a int, and the impl:

impl<A,R> Fn<A,R> for SomethingOrOther
    where A : Clone
{ ... }

Here we will have replaced 'a with a skolemized region '0. This means that our substitution will be {A=>&'0 int, R=>&'0 int}.

When we apply the substitution to the bounds, we will wind up with &'0 int : Clone as a predicate. As a last step, we then go and replace '0 with a late-bound region 'a. The depth is matched to the depth of the predicate, in this case 1, so that the final predicate is for<'a> &'a int : Clone.

[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?

Pops the skolemized regions found in skol_map from the region inference context. Whenever you create skolemized regions via skolemize_late_bound_regions, they must be popped before you commit the enclosing snapshot (if you do not commit, e.g. within a probe or as a result of an error, then this is not necessary, as popping happens as part of the rollback).

Note: popping also occurs implicitly as part of leak_check.

impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx>
[src]

Important traits for Vec<u8>
[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?

Implied bounds are region relationships that we deduce automatically. The idea is that (e.g.) a caller must check that a function's argument types are well-formed immediately before calling that fn, and hence the callee can assume that its argument types are well-formed. This may imply certain relationships between generic parameters. For example:

fn foo<'a,T>(x: &'a T)

can only be called with a 'a and T such that &'a T is WF. For &'a T to be WF, T: 'a must hold. So we can assume T: 'a.

Parameters

  • param_env, the where-clauses in scope
  • body_id, the body-id to use when normalizing assoc types. Note that this may cause outlives obligations to be injected into the inference context with this body-id.
  • ty, the type that we are supposed to assume is WF.
  • span, a span to use when normalizing, hopefully not important, might be useful if a bug! occurs.

impl<'cx, 'gcx, 'tcx> InferCtxt<'cx, 'gcx, 'tcx>
[src]

[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?

Registers that the given region obligation must be resolved from within the scope of body_id. These regions are enqueued and later processed by regionck, when full type information is available (see region_obligations field for more information).

[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?

Process the region obligations that must be proven (during regionck) for the given body_id, given information about the region bounds in scope and so forth. This function must be invoked for all relevant body-ids before region inference is done (or else an assert will fire).

See the region_obligations field of InferCtxt for some comments about how this funtion fits into the overall expected flow of the the inferencer. The key point is that it is invoked after all type-inference variables have been bound -- towards the end of regionck. This also ensures that the region-bound-pairs are available (see comments above regarding closures).

Parameters

  • region_bound_pairs: the set of region bounds implied by the parameters and where-clauses. In particular, each pair ('a, K) in this list tells us that the bounds in scope indicate that K: 'a, where K is either a generic parameter like T or a projection like T::Item.
  • implicit_region_bound: if some, this is a region bound that is considered to hold for all type parameters (the function body).
  • param_env is the parameter environment for the enclosing function.
  • body_id is the body-id whose region obligations are being processed.

Returns

This function may have to perform normalizations, and hence it returns an InferOk with subobligations that must be processed.

[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?

Processes a single ad-hoc region obligation that was not registered in advance.

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

Finishes processes any obligations that remain in the fulfillment context, and then returns the result with all type variables removed and regions erased. Because this is intended for use after type-check has completed, if any errors occur, it will panic. It is used during normalization and other cases where processing the obligations in fulfill_cx may cause type inference variables that appear in result to be unified, and hence we need to process those obligations to get the complete picture of the type.

[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?

[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?

[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?

[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?

[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?

[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?

Returns a type variable's default fallback if any exists. A default must be attached to the variable when created, if it is created without a default, this will return None.

This code does not apply to integral or floating point variables, only to use declared defaults.

See new_ty_var_with_default to create a type variable with a default. See type_variable::Default for details about what a default entails.

Important traits for Vec<u8>
[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?

[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?

[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?

Execute f and commit the bindings

[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?

Execute f and commit the bindings if closure f returns Ok(_)

[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?

[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?

Execute f then unroll any bindings it creates

[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?

[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?

[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?

[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?

[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?

[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?

[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?

[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?

[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?

[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?

[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?

[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?

[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?

Create a fresh region variable with the next available index.

Parameters

  • origin: information about why we created this variable, for use during diagnostics / error-reporting.

[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?

Number of region variables created so far.

[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?

Just a convenient wrapper of next_region_var for using during NLL.

[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?

Create a region inference variable for the given region parameter definition.

[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?

Create a type inference variable for the given type parameter definition. The substitutions are for actual parameters that may be referred to by the default of this type parameter, if it exists. E.g. struct Foo<A, B, C = (A, B)>(...); when used in a path such as Foo::<T, U>::new() will use an inference variable for C with [T, U] as the substitutions for the default, (T, U).

[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?

Given a set of generics defined on a type or impl, returns a substitution mapping each type/region parameter to a fresh inference variable.

[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?

True if errors have been reported since this infcx was created. This is sometimes used as a heuristic to skip reporting errors that often occur as a result of earlier errors, but where it's hard to be 100% sure (e.g., unresolved inference variables, regionck errors).

[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?

Set the "tainted by errors" flag to true. We call this when we observe an error from a prior pass.

[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?

Process the region constraints and report any errors that result. After this, no more unification operations should be done -- or the compiler will panic -- but it is legal to use resolve_type_vars_if_possible as well as fully_resolve.

[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?

Obtains (and clears) the current set of region constraints. The inference context is still usable: further unifications will simply add new constraints.

This method is not meant to be used with normal lexical region resolution. Rather, it is used in the NLL mode as a kind of interim hack: basically we run normal type-check and generate region constraints as normal, but then we take them and translate them into the form that the NLL solver understands. See the NLL module for mode details.

[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?

Takes ownership of the list of variable regions. This implies that all the region constriants have already been taken, and hence that resolve_regions_and_report_errors can never be called. This is used only during NLL processing to "hand off" ownership of the set of region vairables into the NLL region context.

[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?

[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?

[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?

[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?

[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?

Where possible, replaces type/int/float variables in value with their final value. Note that region variables are unaffected. If a type variable has not been unified, it is left as is. This is an idempotent operation that does not affect inference state in any way and so you can do it at will.

[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?

Returns true if T contains unresolved type variables. In the process of visiting T, this will resolve (where possible) type variables in T, but it never constructs the final, resolved type, so it's more efficient than resolve_type_vars_if_possible().

[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?

[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?

Attempts to resolve all type/region variables in value. Region inference must have been run already (e.g., by calling resolve_regions_and_report_errors). If some variable was never unified, an Err results.

This method is idempotent, but it not typically not invoked except during the writeback phase.

[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?

[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?

[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?

[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?

[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?

Given a higher-ranked projection predicate like:

for<'a> <T as Fn<&'a u32>>::Output = &'a u32

and a target trait-ref like:

<T as Fn<&'x u32>>

find a substitution S for the higher-ranked regions (here, ['a => 'x]) such that the predicate matches the trait-ref, and then return the value (here, &'a u32) but with the substitution applied (hence, &'x u32).

See higher_ranked_match in higher_ranked/mod.rs for more details.

[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?

See verify_generic_bound method in region_constraints

[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?

[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?

Obtains the latest type of the given closure; this may be a closure in the current function, in which case its ClosureKind may not yet be known.

[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?

Obtain the signature of a closure. For closures, unlike tcx.fn_sig(def_id), this method will work during the type-checking of the enclosing function and return the closure signature in its partially inferred state.

[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?

Normalizes associated types in value, potentially returning new obligations that must further be processed.

impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx>
[src]

[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?

[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?

Reports that an overflow has occurred and halts compilation. We halt compilation unconditionally because it is important that overflows never be masked -- they basically represent computations whose result could not be truly determined and thus we can't say if the program type checks or not -- and they are unusual occurrences in any case.

[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?

Reports that a cycle was detected which led to overflow and halts compilation. This is equivalent to report_overflow_error except that we can give a more helpful error message (and, in particular, we do not suggest increasing the overflow limit, which is not going to help).

[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?

[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?