Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-def/src/nameres/path_resolution.rs')
-rw-r--r--crates/hir-def/src/nameres/path_resolution.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/hir-def/src/nameres/path_resolution.rs b/crates/hir-def/src/nameres/path_resolution.rs
index cc5fc0a52a..c579bc9194 100644
--- a/crates/hir-def/src/nameres/path_resolution.rs
+++ b/crates/hir-def/src/nameres/path_resolution.rs
@@ -381,7 +381,9 @@ impl DefMap {
let from_legacy_macro = self[module]
.scope
.get_legacy_macro(name)
- .map_or_else(PerNs::none, |m| PerNs::macros(m.into(), Visibility::Public));
+ // FIXME: shadowing
+ .and_then(|it| it.last())
+ .map_or_else(PerNs::none, |&m| PerNs::macros(m.into(), Visibility::Public));
let from_scope = self[module].scope.get(name);
let from_builtin = match self.block {
Some(_) => {