Rework precise capturing syntax
This commit is contained in:
parent
68bd001c00
commit
b1efe1ab5d
54 changed files with 406 additions and 350 deletions
|
@ -532,15 +532,10 @@ pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item<'v>) -> V::
|
|||
try_visit!(visitor.visit_ty(ty));
|
||||
try_visit!(visitor.visit_generics(generics));
|
||||
}
|
||||
ItemKind::OpaqueTy(&OpaqueTy { generics, bounds, precise_capturing_args, .. }) => {
|
||||
ItemKind::OpaqueTy(&OpaqueTy { generics, bounds, .. }) => {
|
||||
try_visit!(visitor.visit_id(item.hir_id()));
|
||||
try_visit!(walk_generics(visitor, generics));
|
||||
walk_list!(visitor, visit_param_bound, bounds);
|
||||
if let Some((precise_capturing_args, _)) = precise_capturing_args {
|
||||
for arg in precise_capturing_args {
|
||||
try_visit!(visitor.visit_precise_capturing_arg(arg));
|
||||
}
|
||||
}
|
||||
}
|
||||
ItemKind::Enum(ref enum_definition, ref generics) => {
|
||||
try_visit!(visitor.visit_generics(generics));
|
||||
|
@ -1147,6 +1142,10 @@ pub fn walk_param_bound<'v, V: Visitor<'v>>(
|
|||
match *bound {
|
||||
GenericBound::Trait(ref typ, _modifier) => visitor.visit_poly_trait_ref(typ),
|
||||
GenericBound::Outlives(ref lifetime) => visitor.visit_lifetime(lifetime),
|
||||
GenericBound::Use(args, _) => {
|
||||
walk_list!(visitor, visit_precise_capturing_arg, args);
|
||||
V::Result::output()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue