@@ -225,6 +225,12 @@ fn iter_export_paths(vi: ast::view_item, f: fn(vp: @ast::view_path)) {
225
225
}
226
226
}
227
227
228
+ fn iter_all_view_paths ( vi : ast:: view_item ,
229
+ f : fn ( vp : @ast:: view_path ) ) {
230
+ iter_import_paths ( vi, f) ;
231
+ iter_export_paths ( vi, f) ;
232
+ }
233
+
228
234
// Locate all modules and imports and index them, so that the next passes can
229
235
// resolve through them.
230
236
fn map_crate ( e : @env , c : @ast:: crate ) {
@@ -284,9 +290,12 @@ fn map_crate(e: @env, c: @ast::crate) {
284
290
}
285
291
}
286
292
293
+ // Note: a glob export works as an implict import, along with a
294
+ // re-export of anything that was exported at the glob-target location.
295
+ // So we wind up reusing the glob-import machinery when looking at
296
+ // glob exports. They just do re-exporting in a later step.
287
297
fn link_glob ( e : @env , vi : @ast:: view_item , sc : scopes , _v : vt < scopes > ) {
288
- iter_import_paths ( * vi) { |vp|
289
- //if it really is a glob import, that is
298
+ iter_all_view_paths ( * vi) { |vp|
290
299
alt vp. node {
291
300
ast:: view_path_glob ( path, _) {
292
301
alt follow_import ( * e, sc, * path, vp. span ) {
@@ -335,7 +344,7 @@ fn map_crate(e: @env, c: @ast::crate) {
335
344
glob_imported_names: new_str_hash ( ) ,
336
345
path: "" } ) ;
337
346
338
- // Next, assemble the links for globbed imports.
347
+ // Next, assemble the links for globbed imports and exports .
339
348
let v_link_glob =
340
349
@{ visit_view_item : bind link_glob( e, _, _, _) ,
341
350
visit_block: visit_block_with_scope,
0 commit comments