Skip to content

Commit 4ac9a2e

Browse files
author
Jonas Schievink
committed
Leave extern crate items unresolved if they are
1 parent 2a9a66d commit 4ac9a2e

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

crates/hir_def/src/nameres/collector.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,11 @@ impl DefCollector<'_> {
420420
.as_ident()
421421
.expect("extern crate should have been desugared to one-element path"),
422422
);
423-
PartialResolvedImport::Resolved(res)
423+
if res.is_none() {
424+
PartialResolvedImport::Unresolved
425+
} else {
426+
PartialResolvedImport::Resolved(res)
427+
}
424428
} else {
425429
let res = self.def_map.resolve_path_fp_with_macro(
426430
self.db,

0 commit comments

Comments
 (0)