1
Fork 0

Delegation implementation: step 1

This commit is contained in:
Bryanskiy 2023-11-26 15:57:31 +03:00
parent 2b1365b34f
commit d69cd6473c
50 changed files with 1634 additions and 93 deletions

View file

@ -2571,9 +2571,17 @@ pub enum OpaqueTyOrigin {
},
}
#[derive(Debug, Clone, Copy, PartialEq, Eq, HashStable_Generic)]
pub enum InferDelegationKind {
Input(usize),
Output,
}
/// The various kinds of types recognized by the compiler.
#[derive(Debug, Clone, Copy, HashStable_Generic)]
pub enum TyKind<'hir> {
/// Actual type should be inherited from `DefId` signature
InferDelegation(DefId, InferDelegationKind),
/// A variable length slice (i.e., `[T]`).
Slice(&'hir Ty<'hir>),
/// A fixed length array (i.e., `[T; n]`).

View file

@ -856,7 +856,7 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) {
visitor.visit_lifetime(lifetime);
}
TyKind::Typeof(ref expression) => visitor.visit_anon_const(expression),
TyKind::Infer | TyKind::Err(_) => {}
TyKind::Infer | TyKind::InferDelegation(..) | TyKind::Err(_) => {}
}
}