@@ -61,11 +61,10 @@ impl MarkSymbolVisitor {
61
61
}
62
62
}
63
63
64
- fn lookup_and_handle_definition ( & mut self , id : & ast:: NodeId ,
65
- span : codemap:: Span ) {
64
+ fn lookup_and_handle_definition ( & mut self , id : & ast:: NodeId ) {
66
65
let def = match self . tcx . def_map . find ( id) {
67
66
Some ( & def) => def,
68
- None => self . tcx . sess . span_bug ( span , "def ID not in def map?!" ) ,
67
+ None => return
69
68
} ;
70
69
let def_id = match def {
71
70
ast:: DefVariant ( enum_id, _, _) => Some ( enum_id) ,
@@ -129,9 +128,6 @@ impl Visitor<()> for MarkSymbolVisitor {
129
128
130
129
fn visit_expr ( & mut self , expr : @ast:: Expr , _: ( ) ) {
131
130
match expr. node {
132
- ast:: ExprPath ( _) | ast:: ExprStruct ( ..) => {
133
- self . lookup_and_handle_definition ( & expr. id , expr. span ) ;
134
- }
135
131
ast:: ExprMethodCall ( ..) => {
136
132
match self . method_map . find ( & expr. id ) {
137
133
Some ( & typeck:: method_map_entry {
@@ -160,12 +156,16 @@ impl Visitor<()> for MarkSymbolVisitor {
160
156
fn visit_ty ( & mut self , typ : & ast:: Ty , _: ( ) ) {
161
157
match typ. node {
162
158
ast:: ty_path( _, _, ref id) => {
163
- self . lookup_and_handle_definition ( id, typ . span ) ;
159
+ self . lookup_and_handle_definition ( id) ;
164
160
}
165
161
_ => visit:: walk_ty ( self , typ, ( ) ) ,
166
162
}
167
163
}
168
164
165
+ fn visit_path ( & mut self , _: & ast:: Path , id : ast:: NodeId , _: ( ) ) {
166
+ self . lookup_and_handle_definition ( & id) ;
167
+ }
168
+
169
169
fn visit_item ( & mut self , _item : @ast:: item , _: ( ) ) {
170
170
// Do not recurse into items. These items will be added to the
171
171
// worklist and recursed into manually if necessary.
0 commit comments