@@ -49,24 +49,21 @@ pub fn find_reachable(crate_mod: &_mod, exp_map2: resolve::ExportMap2,
49
49
method_map : method_map,
50
50
rmap : & mut rmap
51
51
} ;
52
- traverse_public_mod ( cx, ast:: crate_node_id, crate_mod ) ;
52
+ traverse_exports ( cx, ast:: crate_node_id) ;
53
53
traverse_all_resources_and_impls ( cx, crate_mod) ;
54
54
}
55
55
return @rmap;
56
56
}
57
57
58
- fn traverse_exports ( cx : @mut ctx , mod_id : node_id ) -> bool {
59
- let mut found_export = false ;
58
+ fn traverse_exports ( cx : @mut ctx , mod_id : node_id ) {
60
59
match cx. exp_map2 . find ( & mod_id) {
61
60
Some ( ref exp2s) => {
62
61
for ( * exp2s) . each |e2| {
63
- found_export = true ;
64
62
traverse_def_id( cx, e2. def_id)
65
63
} ;
66
64
}
67
65
None => ( )
68
66
}
69
- return found_export;
70
67
}
71
68
72
69
fn traverse_def_id ( cx : @mut ctx , did : def_id ) {
@@ -87,15 +84,6 @@ fn traverse_def_id(cx: @mut ctx, did: def_id) {
87
84
}
88
85
}
89
86
90
- fn traverse_public_mod ( cx : @mut ctx , mod_id : node_id , m : & _mod ) {
91
- if !traverse_exports ( cx, mod_id) {
92
- // No exports, so every local item is exported
93
- for m. items. each |item| {
94
- traverse_public_item ( cx, * item) ;
95
- }
96
- }
97
- }
98
-
99
87
fn traverse_public_item ( cx : @mut ctx , item: @item) {
100
88
{
101
89
// FIXME #6021: naming rmap shouldn't be necessary
@@ -106,15 +94,7 @@ fn traverse_public_item(cx: @mut ctx, item: @item) {
106
94
}
107
95
108
96
match item. node {
109
- item_mod( ref m) => traverse_public_mod ( cx, item. id , m) ,
110
- item_foreign_mod( ref nm) => {
111
- if !traverse_exports ( cx, item. id ) {
112
- for nm. items. each |item| {
113
- let cx = & mut * cx; // FIXME(#6269) reborrow @mut to &mut
114
- cx. rmap . insert ( item. id ) ;
115
- }
116
- }
117
- }
97
+ item_mod( _) | item_foreign_mod( _) => traverse_exports ( cx, item. id ) ,
118
98
item_fn( _, _, _, ref generics, ref blk) => {
119
99
if generics. ty_params . len ( ) > 0 u ||
120
100
attr:: find_inline_attr ( item. attrs ) != attr:: ia_none {
0 commit comments