@@ -1691,7 +1691,7 @@ impl Resolver {
1691
1691
// avoid creating cycles in the
1692
1692
// module graph.
1693
1693
1694
- let resolution = @ImportResolution ( Public , dummy_sp ( ) ) ;
1694
+ let resolution = @ImportResolution ( Private , dummy_sp ( ) ) ;
1695
1695
resolution. outstanding_references = 0 ;
1696
1696
1697
1697
match existing_module. parent_link {
@@ -2159,7 +2159,8 @@ impl Resolver {
2159
2159
let span = import_directive. span ;
2160
2160
let p = import_directive. privacy ;
2161
2161
resolution_result =
2162
- self . resolve_glob_import ( p, module_,
2162
+ self . resolve_glob_import ( p,
2163
+ module_,
2163
2164
containing_module,
2164
2165
span) ;
2165
2166
}
@@ -2284,7 +2285,6 @@ impl Resolver {
2284
2285
fn get_binding ( import_resolution : @ImportResolution ,
2285
2286
namespace : Namespace )
2286
2287
-> NamespaceResult {
2287
-
2288
2288
// Import resolutions must be declared with "pub"
2289
2289
// in order to be exported.
2290
2290
if import_resolution. privacy == Private {
@@ -2506,14 +2506,13 @@ impl Resolver {
2506
2506
containing_module : @Module ,
2507
2507
span : span )
2508
2508
-> ResolveResult < ( ) > {
2509
-
2510
2509
// This function works in a highly imperative manner; it eagerly adds
2511
2510
// everything it can to the list of import resolutions of the module
2512
2511
// node.
2512
+ debug ! ( "(resolving glob import) resolving %? glob import" , privacy) ;
2513
2513
2514
2514
// We must bail out if the node has unresolved imports of any kind
2515
2515
// (including globs).
2516
-
2517
2516
if !( * containing_module) . all_imports_resolved ( ) {
2518
2517
debug ! ( "(resolving glob import) target module has unresolved \
2519
2518
imports; bailing out") ;
@@ -2590,8 +2589,7 @@ impl Resolver {
2590
2589
match module_. import_resolutions . find ( ident) {
2591
2590
None => {
2592
2591
// Create a new import resolution from this child.
2593
- dest_import_resolution = @ImportResolution ( privacy,
2594
- span) ;
2592
+ dest_import_resolution = @ImportResolution ( privacy, span) ;
2595
2593
module_. import_resolutions . insert
2596
2594
( ident, dest_import_resolution) ;
2597
2595
}
@@ -2602,10 +2600,11 @@ impl Resolver {
2602
2600
2603
2601
2604
2602
debug ! ( "(resolving glob import) writing resolution `%s` in `%s` \
2605
- to `%s`",
2603
+ to `%s`, privacy=%? ",
2606
2604
self . session. str_of( ident) ,
2607
2605
self . module_to_str( containing_module) ,
2608
- self . module_to_str( module_) ) ;
2606
+ self . module_to_str( module_) ,
2607
+ dest_import_resolution. privacy) ;
2609
2608
2610
2609
// Merge the child item into the import resolution.
2611
2610
if ( * name_bindings) . defined_in_namespace ( ValueNS ) {
@@ -3142,14 +3141,18 @@ impl Resolver {
3142
3141
3143
3142
fn record_exports_for_module_subtree ( module_ : @Module ) {
3144
3143
// If this isn't a local crate, then bail out. We don't need to record
3145
- // exports for local crates.
3144
+ // exports for nonlocal crates.
3146
3145
3147
3146
match module_. def_id {
3148
3147
Some ( def_id) if def_id. crate == local_crate => {
3149
3148
// OK. Continue.
3149
+ debug ! ( "(recording exports for module subtree) recording \
3150
+ exports for local module") ;
3150
3151
}
3151
3152
None => {
3152
3153
// Record exports for the root module.
3154
+ debug ! ( "(recording exports for module subtree) recording \
3155
+ exports for root module") ;
3153
3156
}
3154
3157
Some ( _) => {
3155
3158
// Bail out.
@@ -3222,15 +3225,21 @@ impl Resolver {
3222
3225
}
3223
3226
3224
3227
fn add_exports_for_module(exports2: &mut ~[Export2], module_: @Module) {
3225
-
3226
3228
for module_.children.each_ref |ident, namebindings| {
3227
3229
debug!(" ( computing exports) maybe export ' %s' ",
3228
3230
self.session.str_of(*ident));
3229
- self.add_exports_of_namebindings(exports2, *ident,
3230
- *namebindings, false)
3231
+ self.add_exports_of_namebindings(exports2,
3232
+ *ident,
3233
+ *namebindings,
3234
+ false)
3231
3235
}
3232
3236
3233
3237
for module_.import_resolutions.each_ref |ident, importresolution| {
3238
+ if importresolution.privacy != Public {
3239
+ debug!(" ( computing exports) not reexporting private `%s`",
3240
+ self . session. str_of( * ident) ) ;
3241
+ loop ;
3242
+ }
3234
3243
for [ TypeNS , ValueNS ] . each |ns| {
3235
3244
match importresolution. target_for_namespace( * ns) {
3236
3245
Some ( target) => {
0 commit comments