pub(crate) struct GenericsSubstForSort<F, 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
Implementation of GenericsSubstDelegate::sort_for_param
Trait Implementations§
Source§impl<F, E> GenericsSubstDelegate for GenericsSubstForSort<F, E>
impl<F, E> GenericsSubstDelegate for GenericsSubstForSort<F, E>
type Error = E
fn sort_for_param(&mut self, param_ty: ParamTy) -> Result<Sort, E>
fn ty_for_param(&mut self, param_ty: ParamTy) -> Result<Ty, E>
fn ctor_for_param(&mut self, param_ty: ParamTy) -> Result<SubsetTyCtor, E>
fn region_for_param(&mut self, ebr: EarlyParamRegion) -> Region
fn const_for_param(&mut self, param: &Const) -> Const
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> 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