@@ -83,7 +83,7 @@ use syntax::symbol::{Symbol, keywords};
83
83
use syntax_pos:: Span ;
84
84
85
85
use rustc:: hir:: { self , map as hir_map, print as pprust} ;
86
- use rustc:: hir:: intravisit:: { self , Visitor } ;
86
+ use rustc:: hir:: intravisit:: { self , Visitor , NestedVisitMode } ;
87
87
use rustc:: hir:: def:: { Def , CtorKind } ;
88
88
use rustc:: hir:: def_id:: DefId ;
89
89
@@ -128,13 +128,17 @@ struct CollectItemTypesVisitor<'a, 'tcx: 'a> {
128
128
ccx : & ' a CrateCtxt < ' a , ' tcx >
129
129
}
130
130
131
- impl < ' a , ' tcx , ' v > Visitor < ' v > for CollectItemTypesVisitor < ' a , ' tcx > {
132
- fn visit_item ( & mut self , item : & hir:: Item ) {
131
+ impl < ' a , ' tcx > Visitor < ' tcx > for CollectItemTypesVisitor < ' a , ' tcx > {
132
+ fn nested_visit_map ( & mut self ) -> Option < ( & hir:: map:: Map < ' tcx > , NestedVisitMode ) > {
133
+ Some ( ( & self . ccx . tcx . map , NestedVisitMode :: OnlyBodies ) )
134
+ }
135
+
136
+ fn visit_item ( & mut self , item : & ' tcx hir:: Item ) {
133
137
convert_item ( self . ccx , item) ;
134
138
intravisit:: walk_item ( self , item) ;
135
139
}
136
140
137
- fn visit_expr ( & mut self , expr : & hir:: Expr ) {
141
+ fn visit_expr ( & mut self , expr : & ' tcx hir:: Expr ) {
138
142
if let hir:: ExprClosure ( ..) = expr. node {
139
143
let def_id = self . ccx . tcx . map . local_def_id ( expr. id ) ;
140
144
generics_of_def_id ( self . ccx , def_id) ;
@@ -143,15 +147,15 @@ impl<'a, 'tcx, 'v> Visitor<'v> for CollectItemTypesVisitor<'a, 'tcx> {
143
147
intravisit:: walk_expr ( self , expr) ;
144
148
}
145
149
146
- fn visit_ty ( & mut self , ty : & hir:: Ty ) {
150
+ fn visit_ty ( & mut self , ty : & ' tcx hir:: Ty ) {
147
151
if let hir:: TyImplTrait ( ..) = ty. node {
148
152
let def_id = self . ccx . tcx . map . local_def_id ( ty. id ) ;
149
153
generics_of_def_id ( self . ccx , def_id) ;
150
154
}
151
155
intravisit:: walk_ty ( self , ty) ;
152
156
}
153
157
154
- fn visit_impl_item ( & mut self , impl_item : & hir:: ImplItem ) {
158
+ fn visit_impl_item ( & mut self , impl_item : & ' tcx hir:: ImplItem ) {
155
159
convert_impl_item ( self . ccx , impl_item) ;
156
160
intravisit:: walk_impl_item ( self , impl_item) ;
157
161
}
0 commit comments