fn visit_ty(&mut self, ty: &hir::Ty) {
match ty.node {
hir::TyBareFn(ref c) => {
- visit::walk_lifetime_decls_helper(self, &c.lifetimes);
self.with(LateScope(&c.lifetimes, self.scope), |old_scope, this| {
// a bare fn has no bounds, so everything
// contained within is scoped within its binder.
|_, this| visit::walk_block(this, b));
}
- fn visit_lifetime_ref(&mut self, lifetime_ref: &hir::Lifetime) {
+ fn visit_lifetime(&mut self, lifetime_ref: &hir::Lifetime) {
if lifetime_ref.name == special_idents::static_lifetime.name {
self.insert_lifetime(lifetime_ref, DefStaticRegion);
return;
fn visit_generics(&mut self, generics: &hir::Generics) {
for ty_param in generics.ty_params.iter() {
- visit::walk_ty_param_bounds_helper(self, &ty_param.bounds);
+ walk_list!(self, visit_ty_param_bound, &ty_param.bounds);
match ty_param.default {
Some(ref ty) => self.visit_ty(&**ty),
None => {}
|old_scope, this| {
this.check_lifetime_defs(old_scope, bound_lifetimes);
this.visit_ty(&**bounded_ty);
- visit::walk_ty_param_bounds_helper(this, bounds);
+ walk_list!(this, visit_ty_param_bound, bounds);
});
self.trait_ref_hack = false;
result
} else {
self.visit_ty(&**bounded_ty);
- visit::walk_ty_param_bounds_helper(self, bounds);
+ walk_list!(self, visit_ty_param_bound, bounds);
}
}
&hir::WherePredicate::RegionPredicate(hir::WhereRegionPredicate{ref lifetime,
ref bounds,
.. }) => {
- self.visit_lifetime_ref(lifetime);
+ self.visit_lifetime(lifetime);
for bound in bounds {
- self.visit_lifetime_ref(bound);
+ self.visit_lifetime(bound);
}
}
&hir::WherePredicate::EqPredicate(hir::WhereEqPredicate{ id,
FreeLifetimeCollector { early_bound: &mut early_bound,
late_bound: &mut late_bound };
for ty_param in generics.ty_params.iter() {
- visit::walk_ty_param_bounds_helper(&mut collector, &ty_param.bounds);
+ walk_list!(&mut collector, visit_ty_param_bound, &ty_param.bounds);
}
for predicate in &generics.where_clause.predicates {
match predicate {
ref bounded_ty,
..}) => {
collector.visit_ty(&**bounded_ty);
- visit::walk_ty_param_bounds_helper(&mut collector, bounds);
+ walk_list!(&mut collector, visit_ty_param_bound, bounds);
}
&hir::WherePredicate::RegionPredicate(hir::WhereRegionPredicate{ref lifetime,
ref bounds,
..}) => {
- collector.visit_lifetime_ref(lifetime);
+ collector.visit_lifetime(lifetime);
for bound in bounds {
- collector.visit_lifetime_ref(bound);
+ collector.visit_lifetime(bound);
}
}
&hir::WherePredicate::EqPredicate(_) => unimplemented!()
}
impl<'a, 'v> Visitor<'v> for FreeLifetimeCollector<'a> {
- fn visit_lifetime_ref(&mut self, lifetime_ref: &hir::Lifetime) {
+ fn visit_lifetime(&mut self, lifetime_ref: &hir::Lifetime) {
shuffle(self.early_bound, self.late_bound,
lifetime_ref.name);
}