yeet CanonicalVarInfo

This commit is contained in:
lcnr 2025-05-23 10:12:55 +00:00
parent 52bf0cf795
commit 326b7e9a6b
18 changed files with 208 additions and 250 deletions

View file

@ -18,7 +18,7 @@ pub trait Interner: Sized {
type Binder<T: TypeVisitable<Self>>: BoundVars<Self> + TypeSuperVisitable<Self>;
type BoundVars: IntoIterator<Item = Self::BoundVar>;
type BoundVar;
type CanonicalVars: Copy + Debug + Hash + Eq + IntoIterator<Item = CanonicalVarInfo<Self>>;
type CanonicalVarKinds: Copy + Debug + Hash + Eq + IntoIterator<Item = CanonicalVarKind<Self>>;
type Ty: Copy
+ DebugWithInfcx<Self>
+ Hash
@ -77,7 +77,7 @@ pub trait Interner: Sized {
type ClosureKind: Copy + Debug + Hash + Eq;
// Required method
fn mk_canonical_var_infos(self, infos: &[CanonicalVarInfo<Self>]) -> Self::CanonicalVars;
fn mk_canonical_var_kinds(self, kinds: &[CanonicalVarKind<Self>]) -> Self::CanonicalVarKinds;
}
pub trait DebugWithInfcx<I: Interner>: Debug {
@ -104,10 +104,6 @@ pub trait TypeSuperVisitable<I: Interner>: TypeVisitable<I> {
fn super_visit_with<V: TypeVisitor<I>>(&self, visitor: &mut V) -> V::Result;
}
pub struct CanonicalVarInfo<I: Interner> {
pub kind: CanonicalVarKind<I>,
}
pub struct CanonicalVarKind<I>(std::marker::PhantomData<I>);
pub struct TyKind<I>(std::marker::PhantomData<I>);

View file

@ -3,13 +3,13 @@
const EXPECTED = [
{
'query': 'canonicalvarinfo, intoiterator -> intoiterator',
'query': 'CanonicalVarKind, intoiterator -> intoiterator',
'others': [],
},
{
'query': '[canonicalvarinfo], interner<tys=intoiterator> -> intoiterator',
'query': '[CanonicalVarKind], interner<tys=intoiterator> -> intoiterator',
'others': [
{ 'path': 'looks_like_rustc_interner::Interner', 'name': 'mk_canonical_var_infos' },
{ 'path': 'looks_like_rustc_interner::Interner', 'name': 'mk_canonical_var_kinds' },
],
},
];