pub struct Hoister<D> {
delegate: D,
in_boxes: bool,
in_downcast: bool,
in_mut_refs: bool,
in_shr_refs: bool,
in_strg_refs: bool,
in_tuples: bool,
existentials: bool,
}
Expand description
The Hoister
struct is responsible for hoisting existentials and predicates out of a type.
It can be configured to stop hoisting at specific type constructors.
The struct is generic on a delegate D
because we use it to do local hoisting, keeping
variables bound with a Binder
, and for freeing variables into the refinement context.
Fields§
§delegate: D
§in_boxes: bool
§in_downcast: bool
§in_mut_refs: bool
§in_shr_refs: bool
§in_strg_refs: bool
§in_tuples: bool
§existentials: bool
Implementations§
Source§impl<D> Hoister<D>
impl<D> Hoister<D>
pub fn with_delegate(delegate: D) -> Self
pub fn hoist_inside_shr_refs(self, shr_refs: bool) -> Self
pub fn hoist_inside_mut_refs(self, mut_refs: bool) -> Self
pub fn hoist_inside_strg_refs(self, strg_refs: bool) -> Self
pub fn hoist_inside_tuples(self, tuples: bool) -> Self
pub fn hoist_inside_boxes(self, boxes: bool) -> Self
pub fn hoist_inside_downcast(self, downcast: bool) -> Self
pub fn hoist_existentials(self, exists: bool) -> Self
pub fn transparent(self) -> Self
pub fn shallow(self) -> Self
Trait Implementations§
Source§impl<D: HoisterDelegate> TypeFolder for Hoister<D>
impl<D: HoisterDelegate> TypeFolder for Hoister<D>
fn fold_ty(&mut self, ty: &Ty) -> Ty
fn fold_bty(&mut self, bty: &BaseTy) -> BaseTy
fn fold_binder<T: TypeFoldable>(&mut self, t: &Binder<T>) -> Binder<T>
fn fold_sort(&mut self, sort: &Sort) -> Sort
fn fold_subset_ty(&mut self, constr: &SubsetTy) -> SubsetTy
fn fold_region(&mut self, re: &Region) -> Region
fn fold_const(&mut self, c: &Const) -> Const
fn fold_expr(&mut self, expr: &Expr) -> Expr
Auto Trait Implementations§
impl<D> Freeze for Hoister<D>where
D: Freeze,
impl<D> RefUnwindSafe for Hoister<D>where
D: RefUnwindSafe,
impl<D> Send for Hoister<D>where
D: Send,
impl<D> Sync for Hoister<D>where
D: Sync,
impl<D> Unpin for Hoister<D>where
D: Unpin,
impl<D> UnwindSafe for Hoister<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<F> FallibleTypeFolder for Fwhere
F: TypeFolder,
impl<F> FallibleTypeFolder for Fwhere
F: TypeFolder,
type Error = !
fn try_fold_binder<T>(
&mut self,
t: &Binder<T>,
) -> Result<Binder<T>, <F as FallibleTypeFolder>::Error>where
T: TypeFoldable,
fn try_fold_sort( &mut self, sort: &Sort, ) -> Result<Sort, <F as FallibleTypeFolder>::Error>
fn try_fold_ty( &mut self, ty: &Ty, ) -> Result<Ty, <F as FallibleTypeFolder>::Error>
fn try_fold_bty( &mut self, bty: &BaseTy, ) -> Result<BaseTy, <F as FallibleTypeFolder>::Error>
fn try_fold_subset_ty( &mut self, ty: &SubsetTy, ) -> Result<SubsetTy, <F as FallibleTypeFolder>::Error>
fn try_fold_region( &mut self, re: &Region, ) -> Result<Region, <F as FallibleTypeFolder>::Error>
fn try_fold_const( &mut self, c: &Const, ) -> Result<Const, <F as FallibleTypeFolder>::Error>
fn try_fold_expr( &mut self, expr: &Expr, ) -> Result<Expr, <F as FallibleTypeFolder>::Error>
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