Skip to content

Commit f95f341

Browse files
committed
Add a regression test for issue #156264
1 parent 32bd660 commit f95f341

2 files changed

Lines changed: 26 additions & 0 deletions

File tree

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// Regression test for issue #156264
2+
3+
mod m_pub {
4+
pub struct S {}
5+
}
6+
7+
mod m_crate {
8+
pub(crate) use crate::m_pub::S;
9+
}
10+
11+
pub(crate) use m_crate::*;
12+
//~^ ERROR `S` is only public within the crate, and cannot be re-exported outside
13+
pub use m_pub::*;
14+
15+
fn main() {}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0365]: `S` is only public within the crate, and cannot be re-exported outside
2+
--> $DIR/ambiguous-import-visibility-globglob-reexport.rs:11:16
3+
|
4+
LL | pub(crate) use m_crate::*;
5+
| ^^^^^^^^^^ re-export of crate public `S`
6+
|
7+
= note: consider declaring type or module `S` with `pub`
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0365`.

0 commit comments

Comments
 (0)