@@ -168,7 +168,7 @@ impl<'a> Resolver<'a> {
168
168
} ;
169
169
170
170
let is_disallowed_private_import = |binding : & NameBinding | {
171
- !allow_private_imports && ! binding. is_pseudo_public ( ) && binding. is_import ( )
171
+ !allow_private_imports && binding. vis != ty :: Visibility :: Public && binding. is_import ( )
172
172
} ;
173
173
174
174
if let Some ( span) = record_used {
@@ -338,7 +338,7 @@ impl<'a> Resolver<'a> {
338
338
} ;
339
339
340
340
// Define `new_binding` in `module`s glob importers.
341
- if new_binding. is_importable ( ) && new_binding . is_pseudo_public ( ) {
341
+ if new_binding. vis == ty :: Visibility :: Public {
342
342
for directive in module. glob_importers . borrow_mut ( ) . iter ( ) {
343
343
let imported_binding = self . import ( new_binding, directive) ;
344
344
let _ = self . try_define ( directive. parent , name, ns, imported_binding) ;
@@ -656,9 +656,8 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
656
656
657
657
if let Some ( Def :: Trait ( _) ) = module. def {
658
658
self . session . span_err ( directive. span , "items in traits are not importable." ) ;
659
- }
660
-
661
- if module. def_id ( ) == directive. parent . def_id ( ) {
659
+ return ;
660
+ } else if module. def_id ( ) == directive. parent . def_id ( ) {
662
661
return ;
663
662
} else if let GlobImport { is_prelude : true } = directive. subclass {
664
663
self . prelude = Some ( module) ;
@@ -674,7 +673,7 @@ impl<'a, 'b:'a> ImportResolver<'a, 'b> {
674
673
resolution. borrow ( ) . binding ( ) . map ( |binding| ( * name, binding) )
675
674
} ) . collect :: < Vec < _ > > ( ) ;
676
675
for ( ( name, ns) , binding) in bindings {
677
- if binding. is_importable ( ) && binding . is_pseudo_public ( ) {
676
+ if binding. pseudo_vis ( ) == ty :: Visibility :: Public {
678
677
let imported_binding = self . import ( binding, directive) ;
679
678
let _ = self . try_define ( directive. parent , name, ns, imported_binding) ;
680
679
}
0 commit comments