flux_middle::rty::subst

Struct GenericsSubstFolder

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

Source

pub(crate) fn new(delegate: D, refine: &'a [Expr]) -> Self

Source§

impl<D> GenericsSubstFolder<'_, D>

Source

fn expr_for_param(&self, idx: u32) -> Expr

Trait Implementations§

Source§

impl<D: GenericsSubstDelegate> FallibleTypeFolder for GenericsSubstFolder<'_, D>

Source§

type Error = <D as GenericsSubstDelegate>::Error

Source§

fn try_fold_binder<T: TypeFoldable>( &mut self, t: &Binder<T>, ) -> Result<Binder<T>, D::Error>

Source§

fn try_fold_sort(&mut self, sort: &Sort) -> Result<Sort, D::Error>

Source§

fn try_fold_ty(&mut self, ty: &Ty) -> Result<Ty, D::Error>

Source§

fn try_fold_subset_ty(&mut self, sty: &SubsetTy) -> Result<SubsetTy, D::Error>

Source§

fn try_fold_region(&mut self, re: &Region) -> Result<Region, D::Error>

Source§

fn try_fold_expr(&mut self, expr: &Expr) -> Result<Expr, D::Error>

Source§

fn try_fold_const(&mut self, c: &Const) -> Result<Const, D::Error>

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<P> IntoQueryParam<P> for P

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.