Skip to content

Commit 69ad912

Browse files
committed
Auto merge of #31566 - jseyfried:fix_regression, r=nrc
This fixes a regression caused by #31461 allowing extern crates to be glob imported, and it fixes the test that was supposed to catch it. r? @nrc
2 parents f9543a9 + 9189463 commit 69ad912

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/librustc_resolve/resolve_imports.rs

+1
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
524524
build_reduced_graph::populate_module_if_necessary(self.resolver, target_module);
525525
target_module.for_each_child(|name, ns, binding| {
526526
if !binding.defined_with(DefModifiers::IMPORTABLE | DefModifiers::PUBLIC) { return }
527+
if binding.is_extern_crate() { return }
527528
self.define(module_, name, ns, directive.import(binding));
528529

529530
if ns == TypeNS && directive.is_public &&

src/test/compile-fail/no-extern-crate-in-glob-import.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
extern crate core;
1515

1616
mod T {
17-
use super::*;
17+
pub use super::*;
1818
}
1919

2020
fn main() {

0 commit comments

Comments
 (0)