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
sourceimpl<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>)> where
N: Copy + Eq + Debug,
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> RefUnwindSafe for AntiUnifier<'infer, I> where
I: RefUnwindSafe,
<I as Interner>::InternedGenericArg: RefUnwindSafe,
impl<'infer, I> Send for AntiUnifier<'infer, I> where
I: Send,
<I as Interner>::InternedGenericArg: Send,
impl<'infer, I> Sync for AntiUnifier<'infer, I> where
I: Sync,
<I as Interner>::InternedGenericArg: Sync,
impl<'infer, I> Unpin for AntiUnifier<'infer, I> where
I: Unpin,
impl<'infer, I> !UnwindSafe for AntiUnifier<'infer, I>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Cast for T
impl<T> Cast for T
sourcefn cast<U>(self, interner: <U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
fn cast<U>(self, interner: <U as HasInterner>::Interner) -> U where
Self: CastTo<U>,
U: HasInterner,
Cast a value to type U
using CastTo
.
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more