diff options
| author | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-09-13 21:11:31 +0300 |
|---|---|---|
| committer | Eduard-Mihai Burtescu <edy.burt@gmail.com> | 2018-09-13 21:11:31 +0300 |
| commit | 84c36a1333c51e90fb952f1ff5f07d71709e548b (patch) | |
| tree | 702cc8549154e67dd7c8f57c8159239d36466928 | |
| parent | 439423834713e7d10d688ef912747e3e9a2fecd2 (diff) | |
| download | rust-84c36a1333c51e90fb952f1ff5f07d71709e548b.tar.gz rust-84c36a1333c51e90fb952f1ff5f07d71709e548b.zip | |
rustc_resolve: ignore uniform_paths canaries with no module scopes.
| -rw-r--r-- | src/librustc_resolve/resolve_imports.rs | 6 |
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;`. |
