pub struct BoundedTyvar<'a> {
pub origin: TyvarOrigin<'a>,
pub bound: TypeBound<'a>,
}
Expand description
boundedtyvar_e in the spec
Because we use a de Bruijn representation of type indices, this is only the type_bound - which variable it is binding is implicit in its position in the list.
Fields§
§origin: TyvarOrigin<'a>
This is not important for typechecking, but is used to keep track of where a type variable originated from in order to decide on a canonical name to be used in bindings generation.
bound: TypeBound<'a>
Implementations§
Source§impl<'a> BoundedTyvar<'a>
impl<'a> BoundedTyvar<'a>
pub fn new(bound: TypeBound<'a>) -> Self
pub fn push_origin(&self, x: Option<ImportExport<'a>>) -> Self
Trait Implementations§
Source§impl<'a> Clone for BoundedTyvar<'a>
impl<'a> Clone for BoundedTyvar<'a>
Source§fn clone(&self) -> BoundedTyvar<'a>
fn clone(&self) -> BoundedTyvar<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for BoundedTyvar<'a>
impl<'a> RefUnwindSafe for BoundedTyvar<'a>
impl<'a> Send for BoundedTyvar<'a>
impl<'a> Sync for BoundedTyvar<'a>
impl<'a> Unpin for BoundedTyvar<'a>
impl<'a> UnwindSafe for BoundedTyvar<'a>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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