Skip to content

Commit 7a69ee0

Browse files
committed
Revert PR #30324, fixing a bug in which a public glob import can make preceding imports public (fixes #30159).
1 parent 9a07087 commit 7a69ee0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/librustc_resolve/resolve_imports.rs

-3
Original file line numberDiff line numberDiff line change
@@ -798,9 +798,6 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
798798
dest_import_resolution.is_public = is_public;
799799
self.add_export(module_, name, &dest_import_resolution);
800800
}
801-
} else {
802-
// FIXME #30159: This is required for backwards compatability.
803-
dest_import_resolution.is_public |= is_public;
804801
}
805802

806803
self.check_for_conflicts_between_imports_and_items(module_,

src/test/compile-fail/shadowed-use-visibility.rs

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ mod foo {
1717

1818
mod bar {
1919
use foo::bar::f as g; //~ ERROR unresolved import
20+
21+
use foo as f;
22+
pub use foo::*;
2023
}
2124

25+
use bar::f::f; //~ ERROR unresolved import
2226
fn main() {}

0 commit comments

Comments
 (0)