summaryrefslogtreecommitdiffstats
path: root/src/test/ui/privacy/privacy3.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/ui/privacy/privacy3.rs')
-rw-r--r--src/test/ui/privacy/privacy3.rs27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/ui/privacy/privacy3.rs b/src/test/ui/privacy/privacy3.rs
new file mode 100644
index 000000000..5a7cd76a9
--- /dev/null
+++ b/src/test/ui/privacy/privacy3.rs
@@ -0,0 +1,27 @@
+#![feature(start, no_core)]
+#![no_core] // makes debugging this test *a lot* easier (during resolve)
+
+// Test to make sure that private items imported through globs remain private
+// when they're used.
+
+mod bar {
+ pub use self::glob::*;
+
+ mod glob {
+ fn gpriv() {}
+ }
+}
+
+pub fn foo() {}
+
+fn test1() {
+ use bar::gpriv;
+ //~^ ERROR unresolved import `bar::gpriv` [E0432]
+ //~| no `gpriv` in `bar`
+
+ // This should pass because the compiler will insert a fake name binding
+ // for `gpriv`
+ gpriv();
+}
+
+#[start] fn main(_: isize, _: *const *const u8) -> isize { 3 }