fn process_const(&mut self,
id: ast::NodeId,
- ident: &ast::Ident,
+ name: ast::Name,
span: Span,
typ: &ast::Ty,
expr: &ast::Expr) {
self.fmt.static_str(span,
sub_span,
id,
- &ident.name.as_str(),
+ &name.as_str(),
&qualname,
&self.span.snippet(expr.span),
&ty_to_string(&*typ),
}
}
- visit::walk_expr_opt(self, base)
+ walk_list!(self, visit_expr, base);
}
fn process_method_call(&mut self, ex: &ast::Expr, args: &Vec<P<ast::Expr>>) {
}
// walk receiver and args
- visit::walk_exprs(self, &args);
+ walk_list!(self, visit_expr, args);
}
fn process_pat(&mut self, p: &ast::Pat) {
fn visit_trait_item(&mut self, trait_item: &ast::TraitItem) {
match trait_item.node {
ast::ConstTraitItem(ref ty, Some(ref expr)) => {
- self.process_const(trait_item.id, &trait_item.ident,
+ self.process_const(trait_item.id, trait_item.ident.name,
trait_item.span, &*ty, &*expr);
}
ast::MethodTraitItem(ref sig, ref body) => {
fn visit_impl_item(&mut self, impl_item: &ast::ImplItem) {
match impl_item.node {
ast::ConstImplItem(ref ty, ref expr) => {
- self.process_const(impl_item.id, &impl_item.ident,
+ self.process_const(impl_item.id, impl_item.ident.name,
impl_item.span, &ty, &expr);
}
ast::MethodImplItem(ref sig, ref body) => {
self.visit_expr(&**sub_ex);
- let hir_node = self.tcx.map.expect_expr(sub_ex.id);
+ let hir_node = lower_expr(sub_ex);
let ty = &self.tcx.expr_ty_adjusted(&hir_node).sty;
match *ty {
ty::TyStruct(def, _) => {
for &(id, ref path, ref_kind) in &paths_to_process {
self.process_path(id, path, ref_kind);
}
- visit::walk_expr_opt(self, &arm.guard);
+ walk_list!(self, visit_expr, &arm.guard);
self.visit_expr(&arm.body);
}
}
// Just walk the initialiser and type (don't want to walk the pattern again).
- visit::walk_ty_opt(self, &l.ty);
- visit::walk_expr_opt(self, &l.init);
+ walk_list!(self, visit_ty, &l.ty);
+ walk_list!(self, visit_expr, &l.init);
}
}