diff options
| author | Manish Goregaokar <manishsmail@gmail.com> | 2016-07-30 13:44:46 +0530 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-07-30 13:44:46 +0530 |
| commit | 8c6421fb17841f5a7071ae691edc76e8b7286bc8 (patch) | |
| tree | 944eb888327cb83be20b8918d10f2c38527a8b8b /src/test | |
| parent | 6234610252a1723467fd52527ffef3180a545ce5 (diff) | |
| parent | 8205691929bc545430f1fa73e61a4f5f77fbbdc7 (diff) | |
| download | rust-8c6421fb17841f5a7071ae691edc76e8b7286bc8.tar.gz rust-8c6421fb17841f5a7071ae691edc76e8b7286bc8.zip | |
Rollup merge of #35063 - jseyfried:avoid_importing_inaccessible_names, r=nrc
resolve: Exclude inaccessible names from single imports If a single import resolves to an inaccessible name in some but not all namespaces, avoid importing the name in the inaccessible namespaces. Currently, the inaccessible namespaces are imported but cause a privacy error when used. r? @nrc
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/privacy-ns2.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/test/compile-fail/privacy-ns2.rs b/src/test/compile-fail/privacy-ns2.rs index bf296220d2a..7accf0ca820 100644 --- a/src/test/compile-fail/privacy-ns2.rs +++ b/src/test/compile-fail/privacy-ns2.rs @@ -25,15 +25,15 @@ pub mod foo1 { } fn test_single1() { - use foo1::Bar; //~ ERROR function `Bar` is private + use foo1::Bar; - Bar(); + Bar(); //~ ERROR unresolved name `Bar` } fn test_list1() { - use foo1::{Bar,Baz}; //~ ERROR `Bar` is private + use foo1::{Bar,Baz}; - Bar(); + Bar(); //~ ERROR unresolved name `Bar` } // private type, public value @@ -46,15 +46,15 @@ pub mod foo2 { } fn test_single2() { - use foo2::Bar; //~ ERROR trait `Bar` is private + use foo2::Bar; - let _x : Box<Bar>; + let _x : Box<Bar>; //~ ERROR type name `Bar` is undefined } fn test_list2() { - use foo2::{Bar,Baz}; //~ ERROR `Bar` is private + use foo2::{Bar,Baz}; - let _x: Box<Bar>; + let _x: Box<Bar>; //~ ERROR type name `Bar` is undefined } // neither public |
