pub struct KVarGen {
kvars: IndexVec<KVid, KVarDecl>,
dummy: bool,
}Fields§
§kvars: IndexVec<KVid, KVarDecl>§dummy: boolIf true, generate dummy holes instead of kvars. Used during shape mode to avoid generating unnecessary kvars.
Implementations§
Source§impl KVarGen
impl KVarGen
pub(crate) fn new(dummy: bool) -> Self
fn get(&self, kvid: KVid) -> &KVarDecl
Sourcepub fn fresh(
&mut self,
binders: &[BoundVariableKinds],
scope: impl IntoIterator<Item = (Var, Sort)>,
encoding: KVarEncoding,
) -> Expr
pub fn fresh( &mut self, binders: &[BoundVariableKinds], scope: impl IntoIterator<Item = (Var, Sort)>, encoding: KVarEncoding, ) -> Expr
Generate a fresh kvar under several layers of binders. Each layer may contain any kind
of bound variable, but variables that are not of kind BoundVariableKind::Refine will
be filtered out.
The variables bound in the last layer (last element of the binders slice) is expected to
have only BoundVariableKind::Refine and all its elements are used as the self arguments.
The rest of the binders are appended to the scope.
Note that the returned expression will have escaping variables and it is up to the caller to put it under an appropriate number of binders.
Prefer using InferCtxt::fresh_kvar when possible.
fn fresh_inner<A>( &mut self, self_args: usize, args: A, encoding: KVarEncoding, ) -> Expr
Auto Trait Implementations§
impl Freeze for KVarGen
impl RefUnwindSafe for KVarGen
impl Send for KVarGen
impl Sync for KVarGen
impl Unpin for KVarGen
impl UnwindSafe for KVarGen
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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