From 584bddef0cc9412b5ab25bb998713d59b5c9f7ef Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Fri, 19 Jun 2020 18:02:54 +0200 Subject: Don't panic on crates depending on themselves Fixes #3883. --- crates/ra_hir_def/src/nameres/collector.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_hir_def') diff --git a/crates/ra_hir_def/src/nameres/collector.rs b/crates/ra_hir_def/src/nameres/collector.rs index 77baa4c69..b8f6aac8f 100644 --- a/crates/ra_hir_def/src/nameres/collector.rs +++ b/crates/ra_hir_def/src/nameres/collector.rs @@ -36,8 +36,8 @@ pub(super) fn collect_defs(db: &dyn DefDatabase, mut def_map: CrateDefMap) -> Cr // populate external prelude for dep in &crate_graph[def_map.krate].dependencies { - let dep_def_map = db.crate_def_map(dep.crate_id); log::debug!("crate dep {:?} -> {:?}", dep.name, dep.crate_id); + let dep_def_map = db.crate_def_map(dep.crate_id); def_map.extern_prelude.insert( dep.as_name(), ModuleId { krate: dep.crate_id, local_id: dep_def_map.root }.into(), -- cgit v1.2.3