pub(crate) struct InferenceVarData<'db> {
span: Span<'db>,
bounds: InferenceVarBounds<'db>,
}Fields§
§span: Span<'db>§bounds: InferenceVarBounds<'db>Bounds on this variable suitable for its kind.
Implementations§
Source§impl<'db> InferenceVarData<'db>
impl<'db> InferenceVarData<'db>
fn new(span: Span<'db>, bounds: InferenceVarBounds<'db>) -> Self
Sourcepub fn new_perm(span: Span<'db>) -> Self
pub fn new_perm(span: Span<'db>) -> Self
Create the data for a new permission inference variable.
Sourcepub fn new_ty(span: Span<'db>, perm: InferVarIndex) -> Self
pub fn new_ty(span: Span<'db>, perm: InferVarIndex) -> Self
Create the data for a new type inference variable.
Requires the index perm of a corresponding permission variable.
Sourcepub fn span(&self) -> Span<'db>
pub fn span(&self) -> Span<'db>
Returns the span of code which triggered the inference variable to be created.
Sourcepub fn kind(&self) -> InferVarKind
pub fn kind(&self) -> InferVarKind
Returns the kind of the inference variable.
Sourcepub fn red_perm_bound(
&self,
direction: Direction,
) -> Option<(RedPerm<'db>, ArcOrElse<'db>)>
pub fn red_perm_bound( &self, direction: Direction, ) -> Option<(RedPerm<'db>, ArcOrElse<'db>)>
Returns the upper or lower bounds on this permission variable.
§Panics
If this is not a permission variable.
Sourcepub fn perm(&self) -> Option<InferVarIndex>
pub fn perm(&self) -> Option<InferVarIndex>
Returns the permission variable corresponding to this type variable.
Returns None if this is a permission variable.
Sourcepub fn red_ty_bound(
&self,
direction: Direction,
) -> Option<(RedTy<'db>, ArcOrElse<'db>)>
pub fn red_ty_bound( &self, direction: Direction, ) -> Option<(RedTy<'db>, ArcOrElse<'db>)>
Returns the lower or upper bound on this type variable, depending on direction.
§Panics
If this is not a type variable.
Sourcepub fn set_red_perm_bound(
&mut self,
direction: Direction,
red_perm: RedPerm<'db>,
or_else: &dyn OrElse<'db>,
)
pub fn set_red_perm_bound( &mut self, direction: Direction, red_perm: RedPerm<'db>, or_else: &dyn OrElse<'db>, )
Insert a red perm as a (lower|upper) bound.
Returns Some(or_else.to_arc()) if this is a new (lower|upper) bound.
Sourcepub fn set_red_ty_bound(
&mut self,
direction: Direction,
red_ty: RedTy<'db>,
or_else: &dyn OrElse<'db>,
)
pub fn set_red_ty_bound( &mut self, direction: Direction, red_ty: RedTy<'db>, or_else: &dyn OrElse<'db>, )
Overwrite the lower or upper bounding red ty, depending on direction.
Returns the to_arc’d version of or_else.
Sourcepub fn fallback(&mut self, db: &'db dyn Db)
pub fn fallback(&mut self, db: &'db dyn Db)
If this inference variable is unbounded, apply a default type. This is invoked
during Runtime::mark_complete
Trait Implementations§
Auto Trait Implementations§
impl<'db> Freeze for InferenceVarData<'db>
impl<'db> !RefUnwindSafe for InferenceVarData<'db>
impl<'db> !Send for InferenceVarData<'db>
impl<'db> !Sync for InferenceVarData<'db>
impl<'db> Unpin for InferenceVarData<'db>
impl<'db> UnsafeUnpin for InferenceVarData<'db>
impl<'db> !UnwindSafe for InferenceVarData<'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
§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