From 4ac9a2e5d3c43401450b812786ab1551d535420c Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Wed, 16 Sep 2020 15:46:56 +0200 Subject: [PATCH] Leave extern crate items unresolved if they are --- crates/hir_def/src/nameres/collector.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/hir_def/src/nameres/collector.rs b/crates/hir_def/src/nameres/collector.rs index bc286a8a339..952a04b35fd 100644 --- a/crates/hir_def/src/nameres/collector.rs +++ b/crates/hir_def/src/nameres/collector.rs @@ -420,7 +420,11 @@ impl DefCollector<'_> { .as_ident() .expect("extern crate should have been desugared to one-element path"), ); - PartialResolvedImport::Resolved(res) + if res.is_none() { + PartialResolvedImport::Unresolved + } else { + PartialResolvedImport::Resolved(res) + } } else { let res = self.def_map.resolve_path_fp_with_macro( self.db,