From 84c36a1333c51e90fb952f1ff5f07d71709e548b Mon Sep 17 00:00:00 2001 From: Eduard-Mihai Burtescu Date: Thu, 13 Sep 2018 21:11:31 +0300 Subject: [PATCH] rustc_resolve: ignore uniform_paths canaries with no module scopes. --- src/librustc_resolve/resolve_imports.rs | 6 ++++++ 1 file changed, 6 insertions(+) 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 @@ struct UniformPathsCanaryResults<'a> { 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;`. -- 2.44.0