about summary refs log tree commit diff
diff options
context:
space:
mode:
authorEduard-Mihai Burtescu <edy.burt@gmail.com>2018-09-13 21:11:31 +0300
committerEduard-Mihai Burtescu <edy.burt@gmail.com>2018-09-13 21:11:31 +0300
commit84c36a1333c51e90fb952f1ff5f07d71709e548b (patch)
tree702cc8549154e67dd7c8f57c8159239d36466928
parent439423834713e7d10d688ef912747e3e9a2fecd2 (diff)
downloadrust-84c36a1333c51e90fb952f1ff5f07d71709e548b.tar.gz
rust-84c36a1333c51e90fb952f1ff5f07d71709e548b.zip
rustc_resolve: ignore uniform_paths canaries with no module scopes.
-rw-r--r--src/librustc_resolve/resolve_imports.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/librustc_resolve/resolve_imports.rs b/src/librustc_resolve/resolve_imports.rs
index 7ee19d0f318..a8e3454b4cb 100644
--- a/src/librustc_resolve/resolve_imports.rs
+++ b/src/librustc_resolve/resolve_imports.rs
@@ -735,6 +735,12 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
                 None
             };
 
+            // Currently imports can't resolve in non-module scopes,
+            // we only have canaries in them for future-proofing.
+            if external_crate.is_none() && results.module_scope.is_none() {
+                return;
+            }
+
             let result_filter = |result: &&NameBinding| {
                 // Ignore canaries that resolve to an import of the same crate.
                 // That is, we allow `use crate_name; use crate_name::foo;`.