pub(crate) struct GenericsSubstFolder<'a, D> {
current_index: DebruijnIndex,
delegate: D,
refinement_args: &'a [Expr],
}
Expand description
Substitution for generics, i.e., early bound types, lifetimes, const generics, and refinements.
Note that a substitution for refinement parameters (a list of expressions) must always be
specified, while the behavior of other generics parameters (types, lifetimes and consts) can be
configured with GenericsSubstDelegate
.
Fields§
§current_index: DebruijnIndex
§delegate: D
§refinement_args: &'a [Expr]
Implementations§
Source§impl<'a, D> GenericsSubstFolder<'a, D>
impl<'a, D> GenericsSubstFolder<'a, D>
Source§impl<D> GenericsSubstFolder<'_, D>
impl<D> GenericsSubstFolder<'_, D>
fn expr_for_param(&self, idx: u32) -> Expr
Trait Implementations§
Source§impl<D: GenericsSubstDelegate> FallibleTypeFolder for GenericsSubstFolder<'_, D>
impl<D: GenericsSubstDelegate> FallibleTypeFolder for GenericsSubstFolder<'_, D>
type Error = <D as GenericsSubstDelegate>::Error
fn try_fold_binder<T: TypeFoldable>( &mut self, t: &Binder<T>, ) -> Result<Binder<T>, D::Error>
fn try_fold_sort(&mut self, sort: &Sort) -> Result<Sort, D::Error>
fn try_fold_ty(&mut self, ty: &Ty) -> Result<Ty, D::Error>
fn try_fold_subset_ty(&mut self, sty: &SubsetTy) -> Result<SubsetTy, D::Error>
fn try_fold_region(&mut self, re: &Region) -> Result<Region, D::Error>
fn try_fold_expr(&mut self, expr: &Expr) -> Result<Expr, D::Error>
fn try_fold_const(&mut self, c: &Const) -> Result<Const, D::Error>
fn try_fold_bty(&mut self, bty: &BaseTy) -> Result<BaseTy, Self::Error>
Auto Trait Implementations§
impl<'a, D> Freeze for GenericsSubstFolder<'a, D>where
D: Freeze,
impl<'a, D> RefUnwindSafe for GenericsSubstFolder<'a, D>where
D: RefUnwindSafe,
impl<'a, D> Send for GenericsSubstFolder<'a, D>where
D: Send,
impl<'a, D> Sync for GenericsSubstFolder<'a, D>where
D: Sync,
impl<'a, D> Unpin for GenericsSubstFolder<'a, D>where
D: Unpin,
impl<'a, D> UnwindSafe for GenericsSubstFolder<'a, D>where
D: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more