Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions compiler/rustc_resolve/src/imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,10 @@ impl<'ra, 'tcx> Resolver<'ra, 'tcx> {
for decl in [resolution.non_glob_decl, resolution.glob_decl] {
if let Some(decl) = decl
&& let DeclKind::Import { source_decl, import } = decl.kind
// FIXME: Do not check visibility-ambiguous imports for now. To check them
// properly we need to preserve all imports in ambiguous glob sets and
// check them all individually.
&& decl.ambiguity_vis_max.get().is_none()
{
// The source entity is too private to be reexported
// with the given import declaration's visibility.
Expand Down
16 changes: 16 additions & 0 deletions tests/ui/imports/ambiguous-import-visibility-globglob-reexport.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// Regression test for issue #156264

//@ check-pass

mod m_pub {
pub struct S {}
}

mod m_crate {
pub(crate) use crate::m_pub::S;
}

pub(crate) use m_crate::*;
pub use m_pub::*;

fn main() {}
Loading