From 698f8c2f01ea549d77d7dc3338a12e04c11057b9 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:02:58 +0200 Subject: Adding upstream version 1.64.0+dfsg1. Signed-off-by: Daniel Baumann --- src/test/ui/privacy/privacy3.rs | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 src/test/ui/privacy/privacy3.rs (limited to 'src/test/ui/privacy/privacy3.rs') 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 } -- cgit v1.2.3