(Re-)Implement impl_trait_in_bindings
This commit is contained in:
parent
1da411e750
commit
d714a22e7b
45 changed files with 391 additions and 25 deletions
|
@ -2906,6 +2906,8 @@ pub enum TyKind<'hir> {
|
|||
Path(QPath<'hir>),
|
||||
/// An opaque type definition itself. This is only used for `impl Trait`.
|
||||
OpaqueDef(&'hir OpaqueTy<'hir>),
|
||||
/// A trait ascription type, which is `impl Trait` within a local binding.
|
||||
TraitAscription(GenericBounds<'hir>),
|
||||
/// A trait object type `Bound1 + Bound2 + Bound3`
|
||||
/// where `Bound` is a trait or a lifetime.
|
||||
TraitObject(&'hir [PolyTraitRef<'hir>], &'hir Lifetime, TraitObjectSyntax),
|
||||
|
|
|
@ -900,6 +900,9 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Resul
|
|||
TyKind::OpaqueDef(opaque) => {
|
||||
try_visit!(visitor.visit_opaque_ty(opaque));
|
||||
}
|
||||
TyKind::TraitAscription(bounds) => {
|
||||
walk_list!(visitor, visit_param_bound, bounds);
|
||||
}
|
||||
TyKind::Array(ref ty, ref length) => {
|
||||
try_visit!(visitor.visit_ty(ty));
|
||||
try_visit!(visitor.visit_const_arg(length));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue