Struct rustc_infer::infer::canonical::Canonical [−][src]
pub struct Canonical<'tcx, V> {
pub max_universe: UniverseIndex,
pub variables: &List<CanonicalVarInfo>,
pub value: V,
}Expand description
A “canonicalized” type V is one where all free inference
variables have been rewritten to “canonical vars”. These are
numbered starting from 0 in order of first appearance.
Fields
max_universe: UniverseIndexvariables: &List<CanonicalVarInfo>value: VTrait Implementations
fn substitute(
&self,
tcx: TyCtxt<'tcx>,
var_values: &CanonicalVarValues<'tcx>
) -> V where
V: TypeFoldable<'tcx>,
fn substitute(
&self,
tcx: TyCtxt<'tcx>,
var_values: &CanonicalVarValues<'tcx>
) -> V where
V: TypeFoldable<'tcx>,
Instantiate the wrapped value, replacing each canonical value
with the value given in var_values. Read more
fn substitute_projected<T>(
&self,
tcx: TyCtxt<'tcx>,
var_values: &CanonicalVarValues<'tcx>,
projection_fn: impl FnOnce(&V) -> T
) -> T where
T: TypeFoldable<'tcx>,
fn substitute_projected<T>(
&self,
tcx: TyCtxt<'tcx>,
var_values: &CanonicalVarValues<'tcx>,
projection_fn: impl FnOnce(&V) -> T
) -> T where
T: TypeFoldable<'tcx>,
Allows one to apply a substitute to some subset of
self.value. Invoke projection_fn with self.value to get
a value V that is expressed in terms of the same canonical
variables bound in self (usually this extracts from subset
of self). Apply the substitution var_values to this value
V, replacing each of the canonical variables. Read more
Auto Trait Implementations
impl<'tcx, V> !RefUnwindSafe for Canonical<V>
impl<'tcx, V> !UnwindSafe for Canonical<V>
Blanket Implementations
Mutably borrows from an owned value. Read more
Layout
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.
