Struct chalk_engine::slg::aggregate::AntiUnifier
source · struct AntiUnifier<'infer, I: Interner> {
infer: &'infer mut InferenceTable<I>,
universe: UniverseIndex,
interner: I,
}
Expand description
Anti-unification is the act of taking two things that do not
unify and finding a minimal generalization of them. So for
example Vec<u32>
anti-unified with Vec<i32>
might be
Vec<?X>
. This is a very simplistic anti-unifier.
NOTE: The values here are canonicalized, but output is not, this means that any escaping bound variables that we see have to be replaced with inference variables.
Fields§
§infer: &'infer mut InferenceTable<I>
§universe: UniverseIndex
§interner: I
Implementations§
source§impl<I: Interner> AntiUnifier<'_, I>
impl<I: Interner> AntiUnifier<'_, I>
fn aggregate_tys(&mut self, ty0: &Ty<I>, ty1: &Ty<I>) -> Ty<I>
fn aggregate_placeholder_tys( &mut self, index1: &PlaceholderIndex, index2: &PlaceholderIndex, ) -> Ty<I>
fn aggregate_projection_tys( &mut self, proj1: &ProjectionTy<I>, proj2: &ProjectionTy<I>, ) -> Ty<I>
fn aggregate_opaque_ty_tys( &mut self, opaque_ty1: &OpaqueTy<I>, opaque_ty2: &OpaqueTy<I>, ) -> Ty<I>
fn aggregate_name_and_substs<N>( &mut self, name1: N, substitution1: &Substitution<I>, name2: N, substitution2: &Substitution<I>, ) -> Option<(N, Substitution<I>)>
fn aggregate_generic_args( &mut self, p1: &GenericArg<I>, p2: &GenericArg<I>, ) -> GenericArg<I>
fn aggregate_lifetimes( &mut self, l1: &Lifetime<I>, l2: &Lifetime<I>, ) -> Lifetime<I>
fn aggregate_consts(&mut self, c1: &Const<I>, c2: &Const<I>) -> Const<I>
fn new_ty_variable(&mut self) -> Ty<I>
fn new_lifetime_variable(&mut self) -> Lifetime<I>
fn new_const_variable(&mut self, ty: Ty<I>) -> Const<I>
Auto Trait Implementations§
impl<'infer, I> Freeze for AntiUnifier<'infer, I>where
I: Freeze,
impl<'infer, I> RefUnwindSafe for AntiUnifier<'infer, I>where
I: RefUnwindSafe,
<I as Interner>::InternedGenericArg: RefUnwindSafe,
impl<'infer, I> Send for AntiUnifier<'infer, I>
impl<'infer, I> Sync for AntiUnifier<'infer, I>
impl<'infer, I> Unpin for AntiUnifier<'infer, I>where
I: Unpin,
impl<'infer, I> !UnwindSafe for AntiUnifier<'infer, I>
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