@@ -23,10 +23,6 @@ pub struct NodeCollector<'ast> {
2323 pub ( super ) map : Vec < MapEntry < ' ast > > ,
2424 /// The parent of this node
2525 pub parent_node : NodeId ,
26- /// If true, completely ignore nested items. We set this when loading
27- /// HIR from metadata, since in that case we only want the HIR for
28- /// one specific item (and not the ones nested inside of it).
29- pub ignore_nested_items : bool
3026}
3127
3228impl < ' ast > NodeCollector < ' ast > {
@@ -35,30 +31,12 @@ impl<'ast> NodeCollector<'ast> {
3531 krate : krate,
3632 map : vec ! [ ] ,
3733 parent_node : CRATE_NODE_ID ,
38- ignore_nested_items : false
3934 } ;
4035 collector. insert_entry ( CRATE_NODE_ID , RootCrate ) ;
4136
4237 collector
4338 }
4439
45- pub ( super ) fn extend ( krate : & ' ast Crate ,
46- parent : & ' ast InlinedItem ,
47- parent_node : NodeId ,
48- map : Vec < MapEntry < ' ast > > )
49- -> NodeCollector < ' ast > {
50- let mut collector = NodeCollector {
51- krate : krate,
52- map : map,
53- parent_node : parent_node,
54- ignore_nested_items : true
55- } ;
56-
57- collector. insert_entry ( parent_node, RootInlinedParent ( parent) ) ;
58-
59- collector
60- }
61-
6240 fn insert_entry ( & mut self , id : NodeId , entry : MapEntry < ' ast > ) {
6341 debug ! ( "ast_map: {:?} => {:?}" , id, entry) ;
6442 let len = self . map . len ( ) ;
@@ -92,27 +70,19 @@ impl<'ast> Visitor<'ast> for NodeCollector<'ast> {
9270
9371 fn visit_nested_item ( & mut self , item : ItemId ) {
9472 debug ! ( "visit_nested_item: {:?}" , item) ;
95- if !self . ignore_nested_items {
96- self . visit_item ( self . krate . item ( item. id ) )
97- }
73+ self . visit_item ( self . krate . item ( item. id ) ) ;
9874 }
9975
10076 fn visit_nested_trait_item ( & mut self , item_id : TraitItemId ) {
101- if !self . ignore_nested_items {
102- self . visit_trait_item ( self . krate . trait_item ( item_id) )
103- }
77+ self . visit_trait_item ( self . krate . trait_item ( item_id) ) ;
10478 }
10579
10680 fn visit_nested_impl_item ( & mut self , item_id : ImplItemId ) {
107- if !self . ignore_nested_items {
108- self . visit_impl_item ( self . krate . impl_item ( item_id) )
109- }
81+ self . visit_impl_item ( self . krate . impl_item ( item_id) ) ;
11082 }
11183
11284 fn visit_nested_body ( & mut self , id : BodyId ) {
113- if !self . ignore_nested_items {
114- self . visit_body ( self . krate . body ( id) )
115- }
85+ self . visit_body ( self . krate . body ( id) ) ;
11686 }
11787
11888 fn visit_item ( & mut self , i : & ' ast Item ) {
0 commit comments