From a79b54ef7323d38b8c02094de32fb45a7c8fff8a Mon Sep 17 00:00:00 2001 From: ivan770 Date: Sun, 16 May 2021 20:05:52 +0200 Subject: Fix #8834 --- crates/hir_def/src/nameres/collector.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'crates/hir_def/src/nameres/collector.rs') diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index adfb78c94..cebc2dc40 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs @@ -481,6 +481,10 @@ impl DefCollector<'_> { let res = self.def_map.resolve_name_in_extern_prelude(self.db, &extern_crate.name); if let Some(ModuleDefId::ModuleId(m)) = res.take_types() { + if m == self.def_map.module_id(current_module_id) { + return; + } + cov_mark::hit!(macro_rules_from_other_crates_are_visible_with_macro_use); self.import_all_macros_exported(current_module_id, m.krate); } -- cgit v1.2.3