flux_middle::rty::subst

Struct GenericsSubstForSort

Source
pub(crate) struct GenericsSubstForSort<F, E>
where F: FnMut(ParamTy) -> Result<Sort, E>,
{ pub(crate) sort_for_param: F, }
Expand description

A substitution meant to be used only for sorts. It’ll panic if used on a type. This is used to break cycles during wf checking. During wf-checking we use rty::Sort, but we can’t yet generate (in general) an rty::GenericArg because conversion from fhir into rty requires the results of wf checking. Perhaps, we could also solve this problem by doing wf-checking with a different “IR” for sorts that sits in between fhir and rty.

Fields§

§sort_for_param: F

Trait Implementations§

Source§

impl<F, E> GenericsSubstDelegate for GenericsSubstForSort<F, E>
where F: FnMut(ParamTy) -> Result<Sort, E>,

Source§

type Error = E

Source§

fn sort_for_param(&mut self, param_ty: ParamTy) -> Result<Sort, E>

Source§

fn ty_for_param(&mut self, param_ty: ParamTy) -> Result<Ty, E>

Source§

fn ctor_for_param(&mut self, param_ty: ParamTy) -> Result<SubsetTyCtor, E>

Source§

fn region_for_param(&mut self, ebr: EarlyParamRegion) -> Region

Source§

fn const_for_param(&mut self, param: &Const) -> Const

Source§

fn expr_for_param_const(&self, param_const: ParamConst) -> Expr

Auto Trait Implementations§

§

impl<F, E> Freeze for GenericsSubstForSort<F, E>
where F: Freeze,

§

impl<F, E> RefUnwindSafe for GenericsSubstForSort<F, E>
where F: RefUnwindSafe,

§

impl<F, E> Send for GenericsSubstForSort<F, E>
where F: Send,

§

impl<F, E> Sync for GenericsSubstForSort<F, E>
where F: Sync,

§

impl<F, E> Unpin for GenericsSubstForSort<F, E>
where F: Unpin,

§

impl<F, E> UnwindSafe for GenericsSubstForSort<F, E>
where F: 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.