pub struct SubtypeChecker<'a> { /* private fields */ }
Expand description
Implements a subtype checker.
Subtype checking is used to type check instantiation arguments.
Implementations§
Source§impl<'a> SubtypeChecker<'a>
impl<'a> SubtypeChecker<'a>
Sourcepub fn new(cache: &'a mut HashSet<(ItemKind, ItemKind)>) -> Self
pub fn new(cache: &'a mut HashSet<(ItemKind, ItemKind)>) -> Self
Creates a new subtype checker with the given cache.
Sourcepub fn is_subtype(
&mut self,
a: ItemKind,
at: &Types,
b: ItemKind,
bt: &Types,
) -> Result<()>
pub fn is_subtype( &mut self, a: ItemKind, at: &Types, b: ItemKind, bt: &Types, ) -> Result<()>
Checks if a
is a subtype of b
.
Sourcepub fn invert(&mut self) -> SubtypeCheck
pub fn invert(&mut self) -> SubtypeCheck
Inverts the current subtype check being performed.
Returns the previous subtype check.
Auto Trait Implementations§
impl<'a> Freeze for SubtypeChecker<'a>
impl<'a> RefUnwindSafe for SubtypeChecker<'a>
impl<'a> Send for SubtypeChecker<'a>
impl<'a> Sync for SubtypeChecker<'a>
impl<'a> Unpin for SubtypeChecker<'a>
impl<'a> !UnwindSafe for SubtypeChecker<'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