@@ -622,6 +622,19 @@ pub impl NameBindings {
622
622
}
623
623
}
624
624
625
+ fn defined_in_public_namespace(namespace: Namespace) -> bool {
626
+ match namespace {
627
+ TypeNS => match self.type_def {
628
+ Some(def) => def.privacy != Private,
629
+ None => false
630
+ },
631
+ ValueNS => match self.value_def {
632
+ Some(def) => def.privacy != Private,
633
+ None => false
634
+ }
635
+ }
636
+ }
637
+
625
638
fn def_for_namespace(namespace: Namespace) -> Option<def> {
626
639
match namespace {
627
640
TypeNS => {
@@ -2538,7 +2551,6 @@ pub impl Resolver {
2538
2551
}
2539
2552
}
2540
2553
2541
-
2542
2554
debug ! ( "(resolving glob import) writing resolution `%s` in `%s` \
2543
2555
to `%s`, privacy=%?",
2544
2556
* self . session. str_of( ident) ,
@@ -2547,12 +2559,12 @@ pub impl Resolver {
2547
2559
dest_import_resolution. privacy) ;
2548
2560
2549
2561
// Merge the child item into the import resolution.
2550
- if ( * name_bindings) . defined_in_namespace ( ValueNS ) {
2562
+ if ( * name_bindings) . defined_in_public_namespace ( ValueNS ) {
2551
2563
debug ! ( "(resolving glob import) ... for value target" ) ;
2552
2564
dest_import_resolution. value_target =
2553
2565
Some ( Target ( containing_module, name_bindings) ) ;
2554
2566
}
2555
- if ( * name_bindings) . defined_in_namespace ( TypeNS ) {
2567
+ if ( * name_bindings) . defined_in_public_namespace ( TypeNS ) {
2556
2568
debug ! ( "(resolving glob import) ... for type target" ) ;
2557
2569
dest_import_resolution. type_target =
2558
2570
Some ( Target ( containing_module, name_bindings) ) ;
0 commit comments