enum VariableType<'db> {
Ast(VariableDecl<'db>),
InProgress(VariableDecl<'db>),
Symbolic(SymTy<'db>),
}Expand description
The type of a variable.
Variants§
Ast(VariableDecl<'db>)
AST form of the type is available and we have not yet begun to symbolify it. AST types are used when we introduce a set of variables, where each variable may refer to others as part of its type. In that case we don’t know the right order to process the variables in so we have to do a depth-first search.
e.g., in fn foo(x: shared[y] String, y: my Vec[String]), we could begin with
y then x, but that is not clear at first. So instead we begin with x, mark it as
in progress, and then to convert y to a symbolic expression, wind up converting
the type of y. If y did refer to x, this would result in an error.
InProgress(VariableDecl<'db>)
AST form of the type is available and we have begun symbolifying it. When in this state, a repeated request for the variable’s type will report an error.
Symbolic(SymTy<'db>)
Symbolic type is available. For local variables, we introduce the type directly in this form, but for parameters or other cases where there are a set of variables introduced at once, we have to begin with AST form.
Trait Implementations§
Source§impl<'db> Clone for VariableType<'db>
impl<'db> Clone for VariableType<'db>
Source§fn clone(&self) -> VariableType<'db>
fn clone(&self) -> VariableType<'db>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl<'db> Copy for VariableType<'db>
Auto Trait Implementations§
impl<'db> Freeze for VariableType<'db>
impl<'db> !RefUnwindSafe for VariableType<'db>
impl<'db> Send for VariableType<'db>
impl<'db> Sync for VariableType<'db>
impl<'db> Unpin for VariableType<'db>
impl<'db> UnsafeUnpin for VariableType<'db>
impl<'db> !UnwindSafe for VariableType<'db>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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>
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>
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