Skip to content

Commit 27617b5

Browse files
authored
Unrolled build for #156284
Rollup merge of #156284 - petrochenkov:kvak2, r=mu001999 resolve: Fix a false positive "cannot reexport" error for ambiguous glob sets Fixes #156264.
2 parents 2aabf3c + 235fa6b commit 27617b5

2 files changed

Lines changed: 20 additions & 0 deletions

File tree

compiler/rustc_resolve/src/imports.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -823,6 +823,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
823823
for decl in [resolution.non_glob_decl, resolution.glob_decl] {
824824
if let Some(decl) = decl
825825
&& let DeclKind::Import { source_decl, import } = decl.kind
826+
// FIXME: Do not check visibility-ambiguous imports for now. To check them
827+
// properly we need to preserve all imports in ambiguous glob sets and
828+
// check them all individually.
829+
&& decl.ambiguity_vis_max.get().is_none()
826830
{
827831
// The source entity is too private to be reexported
828832
// with the given import declaration's visibility.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// Regression test for issue #156264
2+
3+
//@ check-pass
4+
5+
mod m_pub {
6+
pub struct S {}
7+
}
8+
9+
mod m_crate {
10+
pub(crate) use crate::m_pub::S;
11+
}
12+
13+
pub(crate) use m_crate::*;
14+
pub use m_pub::*;
15+
16+
fn main() {}

0 commit comments

Comments
 (0)