pub struct TypeVariable { /* private fields */ }Expand description
A type variable: a placeholder unify may solve to a type, or a rigid one, which it
may not.
A flexible variable is the inference variable of an expression, and the variable of a
declared type a use instantiates. A rigid variable is one the declaration being
checked is universally quantified over: the variables its annotation wrote, or the
variables of an instance’s head and of the member signature its bindings are held to
(make_rigid makes them). It stands for every type a caller may choose, so it is
equal to itself and to nothing else, and unifier::unify raises
ErrorKind::RigidVariable where a body would need it to be anything more specific.
A rigid variable is a flexible one’s id with the name the source wrote it by, which is
what a message writes it as. The id is what tells two variables apart: two rigid
variables may be written alike, as an instance’s head and the member signature its
binding is held to each write their own.
A rigid variable belongs to the declaration whose body is checked: the types of the term
that comes back hold it, and nothing the environment holds for another declaration does.
What the environment holds for a use, a Scheme, is over flexible variables, which each
use instantiates fresh.
Trait Implementations§
Source§impl Clone for TypeVariable
impl Clone for TypeVariable
Source§fn clone(&self) -> TypeVariable
fn clone(&self) -> TypeVariable
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for TypeVariable
impl Debug for TypeVariable
impl Eq for TypeVariable
Source§impl Hash for TypeVariable
impl Hash for TypeVariable
Source§impl PartialEq for TypeVariable
impl PartialEq for TypeVariable
impl StructuralPartialEq for TypeVariable
Auto Trait Implementations§
impl Freeze for TypeVariable
impl RefUnwindSafe for TypeVariable
impl Send for TypeVariable
impl Sync for TypeVariable
impl Unpin for TypeVariable
impl UnsafeUnpin for TypeVariable
impl UnwindSafe for TypeVariable
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.