about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2016-02-15 05:19:29 +0000
committerbors <bors@rust-lang.org>2016-02-15 05:19:29 +0000
commit69ad91290de8416cb309ed303ba0883b12b8017a (patch)
treef30c19175e70368805547f01a05fbfda401190b0 /src
parentf9543a9b747225a85a010c020d1b65b4b48ba4dd (diff)
parent91894631d005e30f2cd7af23c0d5512a20148472 (diff)
downloadrust-69ad91290de8416cb309ed303ba0883b12b8017a.tar.gz
rust-69ad91290de8416cb309ed303ba0883b12b8017a.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/librustc_resolve/resolve_imports.rs1
-rw-r--r--src/test/compile-fail/no-extern-crate-in-glob-import.rs2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs
index f21ffb9b9a1..cc2b25633e0 100644
--- a/src/librustc_resolve/resolve_imports.rs
+++ b/src/librustc_resolve/resolve_imports.rs
@@ -524,6 +524,7 @@ impl<'a, 'b:'a, 'tcx:'b> ImportResolver<'a, 'b, 'tcx> {
         build_reduced_graph::populate_module_if_necessary(self.resolver, target_module);
         target_module.for_each_child(|name, ns, binding| {
             if !binding.defined_with(DefModifiers::IMPORTABLE | DefModifiers::PUBLIC) { return }
+            if binding.is_extern_crate() { return }
             self.define(module_, name, ns, directive.import(binding));
 
             if ns == TypeNS && directive.is_public &&
diff --git a/src/test/compile-fail/no-extern-crate-in-glob-import.rs b/src/test/compile-fail/no-extern-crate-in-glob-import.rs
index 5d3efd85134..75882c5e981 100644
--- a/src/test/compile-fail/no-extern-crate-in-glob-import.rs
+++ b/src/test/compile-fail/no-extern-crate-in-glob-import.rs
@@ -14,7 +14,7 @@
 extern crate core;
 
 mod T {
-    use super::*;
+    pub use super::*;
 }
 
 fn main() {