pub(crate) struct SubstFolder<'i, I: Interner, A: AsParameters<I>> {
    pub(crate) interner: I,
    pub(crate) subst: &'i A,
}

Fields

interner: Isubst: &'i A

Implementations

Index into the list of parameters.

Trait Implementations

The type this folder returns when folding fails. This is commonly NoSolution. Read more
Creates a dyn value from this folder. Unfortunately, this must be added manually to each impl of FallibleTypeFolder; it permits the default implements below to create a &mut dyn FallibleTypeFolder from Self without knowing what Self is (by invoking this method). Effectively, this limits impls of FallibleTypeFolder to types for which we are able to create a dyn value (i.e., not [T] types). Read more
Top-level callback: invoked for each Ty<I> that is encountered when folding. By default, invokes try_super_fold_with, which will in turn invoke the more specialized folding methods below, like try_fold_free_var_ty. Read more
Top-level callback: invoked for each Lifetime<I> that is encountered when folding. By default, invokes try_super_fold_with, which will in turn invoke the more specialized folding methods below, like try_fold_free_var_lifetime. Read more
Top-level callback: invoked for each Const<I> that is encountered when folding. By default, invokes try_super_fold_with, which will in turn invoke the more specialized folding methods below, like try_fold_free_var_const. Read more
Invoked for every program clause. By default, recursively folds the goals contents.
Invoked for every goal. By default, recursively folds the goals contents.
If overridden to return true, then folding will panic if a free variable is encountered. This should be done if free type/lifetime variables are not expected. Read more
Invoked for TyKind::BoundVar instances that are not bound within the type being folded over: Read more
As try_fold_free_var_ty, but for lifetimes.
As try_fold_free_var_ty, but for constants.
If overridden to return true, we will panic when a free placeholder type/lifetime/const is encountered. Read more
Invoked for each occurrence of a placeholder type; these are used when we instantiate binders universally. Returns a type to use instead, which should be suitably shifted to account for binders. Read more
As with try_fold_free_placeholder_ty, but for lifetimes.
As with try_fold_free_placeholder_ty, but for constants.
If overridden to return true, inference variables will trigger panics when folded. Used when inference variables are unexpected. Read more
Invoked for each occurrence of a inference type; these are used when we instantiate binders universally. Returns a type to use instead, which should be suitably shifted to account for binders. Read more
As with try_fold_inference_ty, but for lifetimes.
As with try_fold_inference_ty, but for constants.
Gets the interner that is being folded from.
Creates a dyn value from this folder. Unfortunately, this must be added manually to each impl of TypeFolder; it permits the default implements below to create a &mut dyn TypeFolder from Self without knowing what Self is (by invoking this method). Effectively, this limits impls of TypeFolder to types for which we are able to create a dyn value (i.e., not [T] types). Read more
Invoked for TyKind::BoundVar instances that are not bound within the type being folded over: Read more
As fold_free_var_ty, but for lifetimes.
As fold_free_var_ty, but for constants.
Gets the interner that is being folded from.
Top-level callback: invoked for each Ty<I> that is encountered when folding. By default, invokes super_fold_with, which will in turn invoke the more specialized folding methods below, like fold_free_var_ty. Read more
Top-level callback: invoked for each Lifetime<I> that is encountered when folding. By default, invokes super_fold_with, which will in turn invoke the more specialized folding methods below, like fold_free_var_lifetime. Read more
Top-level callback: invoked for each Const<I> that is encountered when folding. By default, invokes super_fold_with, which will in turn invoke the more specialized folding methods below, like fold_free_var_const. Read more
Invoked for every program clause. By default, recursively folds the goals contents.
Invoked for every goal. By default, recursively folds the goals contents.
If overridden to return true, then folding will panic if a free variable is encountered. This should be done if free type/lifetime variables are not expected. Read more
If overridden to return true, we will panic when a free placeholder type/lifetime/const is encountered. Read more
Invoked for each occurrence of a placeholder type; these are used when we instantiate binders universally. Returns a type to use instead, which should be suitably shifted to account for binders. Read more
As with fold_free_placeholder_ty, but for lifetimes.
As with fold_free_placeholder_ty, but for constants.
If overridden to return true, inference variables will trigger panics when folded. Used when inference variables are unexpected. Read more
Invoked for each occurrence of a inference type; these are used when we instantiate binders universally. Returns a type to use instead, which should be suitably shifted to account for binders. Read more
As with fold_inference_ty, but for lifetimes.
As with fold_inference_ty, but for constants.

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
Cast a value to type U using CastTo.

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 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.