Skip to content

Commit 87403b8

Browse files
committed
Make pub single imports of private extern crates public.
1 parent 573c1d5 commit 87403b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc_resolve/resolve_imports.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,9 @@ impl<'a> ImportDirective<'a> {
7878
};
7979
if let GlobImport = self.subclass {
8080
modifiers = modifiers | DefModifiers::GLOB_IMPORTED;
81+
} else if self.is_public && binding.is_extern_crate() {
82+
// `pub` single imports of private extern crates are public (see #31362).
83+
modifiers = modifiers | DefModifiers::PUBLIC;
8184
}
8285

8386
NameBinding {

0 commit comments

Comments
 (0)