pub struct Inference<'db> {
    pub enabled: bool,
    /* private fields */
}
Expand description

State of inference.

Fields§

§enabled: bool

Whether inference is enabled.

Implementations§

Creates a new Inference instance.

Creates a disabled Inference instance, where no inference is being performed.

Allocated a new TypeVar for an unknown type that needs to be inferred,

Retrieves the first variable that is still not inferred, or None, if everything is inferred.

Gets current canonical representation for a TypeId after all known substitutions.

Gets current canonical representation for a ConcreteVariant after all known substitutions.

Gets current canonical representation for a ConcreteEnumId after all known substitutions.

Gets current canonical representation for a TypeVar after all known substitutions.

Gets current canonical representation for a GenericArgumentId vector after all known substitutions.

Gets current canonical representation for a Pattern after all known substitutions, and updates inplace.

Conforms ty0 to ty1. Should be called when ty0 should be coerced to ty1. Not symmetric. Returns the reduced type for ty0, or an error if the type is no coercible.

Conforms a generics arg. See conform_ty().

Checks if the a type tree contains a certain TypeVar somewhere. Used to avoid inference cycles.

Determines if an assignment to generic_params can be chosen s.t. generic_args will be substituted to expected_generic_args.

Chooses and assignment to generic_params s.t. generic_args will be substituted to expected_generic_args. Returns the generic_params assignment.

Tries to infer a trait function as a method for self_ty.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.