|
15 | 15 |
|
16 | 16 | use crate::ast::*;
|
17 | 17 |
|
18 |
| -use rustc_span::symbol::{Ident, Symbol}; |
| 18 | +use rustc_span::symbol::Ident; |
19 | 19 | use rustc_span::Span;
|
20 | 20 |
|
21 | 21 | #[derive(Copy, Clone, Debug, PartialEq)]
|
@@ -109,12 +109,7 @@ pub enum LifetimeCtxt {
|
109 | 109 | /// to monitor future changes to `Visitor` in case a new method with a
|
110 | 110 | /// new default implementation gets introduced.)
|
111 | 111 | pub trait Visitor<'ast>: Sized {
|
112 |
| - fn visit_name(&mut self, _span: Span, _name: Symbol) { |
113 |
| - // Nothing to do. |
114 |
| - } |
115 |
| - fn visit_ident(&mut self, ident: Ident) { |
116 |
| - walk_ident(self, ident); |
117 |
| - } |
| 112 | + fn visit_ident(&mut self, _ident: Ident) {} |
118 | 113 | fn visit_foreign_item(&mut self, i: &'ast ForeignItem) {
|
119 | 114 | walk_foreign_item(self, i)
|
120 | 115 | }
|
@@ -267,10 +262,6 @@ macro_rules! walk_list {
|
267 | 262 | }
|
268 | 263 | }
|
269 | 264 |
|
270 |
| -pub fn walk_ident<'a, V: Visitor<'a>>(visitor: &mut V, ident: Ident) { |
271 |
| - visitor.visit_name(ident.span, ident.name); |
272 |
| -} |
273 |
| - |
274 | 265 | pub fn walk_crate<'a, V: Visitor<'a>>(visitor: &mut V, krate: &'a Crate) {
|
275 | 266 | walk_list!(visitor, visit_item, &krate.items);
|
276 | 267 | walk_list!(visitor, visit_attribute, &krate.attrs);
|
@@ -315,11 +306,7 @@ pub fn walk_item<'a, V: Visitor<'a>>(visitor: &mut V, item: &'a Item) {
|
315 | 306 | visitor.visit_vis(&item.vis);
|
316 | 307 | visitor.visit_ident(item.ident);
|
317 | 308 | match item.kind {
|
318 |
| - ItemKind::ExternCrate(orig_name) => { |
319 |
| - if let Some(orig_name) = orig_name { |
320 |
| - visitor.visit_name(item.span, orig_name); |
321 |
| - } |
322 |
| - } |
| 309 | + ItemKind::ExternCrate(_) => {} |
323 | 310 | ItemKind::Use(ref use_tree) => visitor.visit_use_tree(use_tree, item.id, false),
|
324 | 311 | ItemKind::Static(ref typ, _, ref expr) | ItemKind::Const(_, ref typ, ref expr) => {
|
325 | 312 | visitor.visit_ty(typ);
|
|
0 commit comments