Support ?Trait bounds in supertraits and dyn Trait under a feature gate
This commit is contained in:
parent
28e684b470
commit
2a73553513
34 changed files with 305 additions and 85 deletions
|
@ -2832,7 +2832,11 @@ pub enum TyKind<'hir> {
|
|||
OpaqueDef(ItemId, &'hir [GenericArg<'hir>], bool),
|
||||
/// A trait object type `Bound1 + Bound2 + Bound3`
|
||||
/// where `Bound` is a trait or a lifetime.
|
||||
TraitObject(&'hir [PolyTraitRef<'hir>], &'hir Lifetime, TraitObjectSyntax),
|
||||
TraitObject(
|
||||
&'hir [(PolyTraitRef<'hir>, TraitBoundModifier)],
|
||||
&'hir Lifetime,
|
||||
TraitObjectSyntax,
|
||||
),
|
||||
/// Unused for now.
|
||||
Typeof(&'hir AnonConst),
|
||||
/// `TyKind::Infer` means the type should be inferred instead of it having been
|
||||
|
|
|
@ -902,7 +902,9 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Resul
|
|||
try_visit!(visitor.visit_array_length(length));
|
||||
}
|
||||
TyKind::TraitObject(bounds, ref lifetime, _syntax) => {
|
||||
walk_list!(visitor, visit_poly_trait_ref, bounds);
|
||||
for (bound, _modifier) in bounds {
|
||||
try_visit!(visitor.visit_poly_trait_ref(bound));
|
||||
}
|
||||
try_visit!(visitor.visit_lifetime(lifetime));
|
||||
}
|
||||
TyKind::Typeof(ref expression) => try_visit!(visitor.visit_anon_const(expression)),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue