From 26e784a575c760087bdb321932e823ad27046024 Mon Sep 17 00:00:00 2001 From: Lukas Wirth Date: Wed, 26 May 2021 21:09:27 +0200 Subject: simplify --- crates/hir/src/source_analyzer.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'crates/hir') diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs index 3f940124c..37a050415 100644 --- a/crates/hir/src/source_analyzer.rs +++ b/crates/hir/src/source_analyzer.rs @@ -308,7 +308,11 @@ impl SourceAnalyzer { } } - resolve_hir_path_(db, &self.resolver, &hir_path, prefer_value_ns) + if parent().map_or(false, |it| ast::Visibility::can_cast(it.kind())) { + resolve_hir_path_qualifier(db, &self.resolver, &hir_path) + } else { + resolve_hir_path_(db, &self.resolver, &hir_path, prefer_value_ns) + } } pub(crate) fn record_literal_missing_fields( -- cgit v1.2.3