Skip to content

Commit 721dbee

Browse files
committed
---
yaml --- r: 14462 b: refs/heads/try c: 1f4a6bb h: refs/heads/master v: v3
1 parent 49334ea commit 721dbee

File tree

2 files changed

+13
-4
lines changed

2 files changed

+13
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
refs/heads/master: 61b1875c16de39c166b0f4d54bba19f9c6777d1a
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
5-
refs/heads/try: 893bbea5765a3e9a6a1581c7f8cc1fc02a2cc7ae
5+
refs/heads/try: 1f4a6bb3ad8774c0b852bb4ffca83dd40a188570
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

branches/try/src/comp/middle/resolve.rs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,12 @@ fn iter_export_paths(vi: ast::view_item, f: fn(vp: @ast::view_path)) {
225225
}
226226
}
227227

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+
228234
// Locate all modules and imports and index them, so that the next passes can
229235
// resolve through them.
230236
fn map_crate(e: @env, c: @ast::crate) {
@@ -284,9 +290,12 @@ fn map_crate(e: @env, c: @ast::crate) {
284290
}
285291
}
286292

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.
287297
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|
290299
alt vp.node {
291300
ast::view_path_glob(path, _) {
292301
alt follow_import(*e, sc, *path, vp.span) {
@@ -335,7 +344,7 @@ fn map_crate(e: @env, c: @ast::crate) {
335344
glob_imported_names: new_str_hash(),
336345
path: ""});
337346

338-
// Next, assemble the links for globbed imports.
347+
// Next, assemble the links for globbed imports and exports.
339348
let v_link_glob =
340349
@{visit_view_item: bind link_glob(e, _, _, _),
341350
visit_block: visit_block_with_scope,

0 commit comments

Comments
 (0)