File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -167,8 +167,10 @@ impl<'a> Resolver<'a> {
167
167
_ => return Failed ( None ) , // This happens when there is a cycle of imports
168
168
} ;
169
169
170
+ let new_import_semantics = self . new_import_semantics ;
170
171
let is_disallowed_private_import = |binding : & NameBinding | {
171
- !allow_private_imports && binding. vis != ty:: Visibility :: Public && binding. is_import ( )
172
+ !new_import_semantics && !allow_private_imports && // disallowed
173
+ binding. vis != ty:: Visibility :: Public && binding. is_import ( ) // non-`pub` import
172
174
} ;
173
175
174
176
if let Some ( span) = record_used {
Original file line number Diff line number Diff line change
1
+ // Copyright 2016 The Rust Project Developers. See the COPYRIGHT
2
+ // file at the top-level directory of this distribution and at
3
+ // http://rust-lang.org/COPYRIGHT.
4
+ //
5
+ // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6
+ // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7
+ // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8
+ // option. This file may not be copied, modified, or distributed
9
+ // except according to those terms.
10
+
11
+ #![ feature( item_like_imports) ]
12
+ #![ allow( unused) ]
13
+
14
+ // Like other items, private imports can be imported and used non-lexically in paths.
15
+ mod a {
16
+ use a as foo;
17
+ use self :: foo:: foo as bar;
18
+
19
+ mod b {
20
+ use super :: bar;
21
+ }
22
+ }
23
+
24
+ fn main ( ) { }
You can’t perform that action at this time.
0 commit comments