Thread pattern types through the HIR
This commit is contained in:
parent
c340e67dec
commit
c4efc25bfa
15 changed files with 48 additions and 5 deletions
|
@ -2624,6 +2624,8 @@ pub enum TyKind<'hir> {
|
|||
Infer,
|
||||
/// Placeholder for a type that has failed to be defined.
|
||||
Err(rustc_span::ErrorGuaranteed),
|
||||
/// Pattern types (`u32 as 1..`)
|
||||
Pat(&'hir Ty<'hir>, &'hir Pat<'hir>),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Copy, HashStable_Generic)]
|
||||
|
|
|
@ -882,6 +882,10 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Resul
|
|||
TyKind::AnonAdt(item_id) => {
|
||||
try_visit!(visitor.visit_nested_item(item_id));
|
||||
}
|
||||
TyKind::Pat(ty, pat) => {
|
||||
try_visit!(visitor.visit_ty(ty));
|
||||
try_visit!(visitor.visit_pat(pat));
|
||||
}
|
||||
}
|
||||
V::Result::output()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue