Skip to content

Commit 84c36a1

Browse files
committed
rustc_resolve: ignore uniform_paths canaries with no module scopes.
1 parent 4394238 commit 84c36a1

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: src/librustc_resolve/resolve_imports.rs

+6
Original file line numberDiff line numberDiff line change
@@ -735,6 +735,12 @@ impl<'a, 'b:'a, 'c: 'b> ImportResolver<'a, 'b, 'c> {
735735
None
736736
};
737737

738+
// Currently imports can't resolve in non-module scopes,
739+
// we only have canaries in them for future-proofing.
740+
if external_crate.is_none() && results.module_scope.is_none() {
741+
return;
742+
}
743+
738744
let result_filter = |result: &&NameBinding| {
739745
// Ignore canaries that resolve to an import of the same crate.
740746
// That is, we allow `use crate_name; use crate_name::foo;`.

0 commit comments

Comments
 (0)