aboutsummaryrefslogtreecommitdiff
path: root/crates/hir/src/source_analyzer.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-02-12 13:18:30 +0000
committerGitHub <[email protected]>2021-02-12 13:18:30 +0000
commitdee5aba43a1b45131bf31268431fa71923f2ef2a (patch)
tree9a43e69bd5591d7e436fe236668d6769f5d500ea /crates/hir/src/source_analyzer.rs
parenta044ac980cca07913e64a7c5fab53f7fe7cecb81 (diff)
parente938d769d922feb374967d5b695e3b3baa70a566 (diff)
Merge #7644
7644: Primitive completion r=jonas-schievink a=jonas-schievink Fixes https://github.com/rust-analyzer/rust-analyzer/issues/7642 Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/hir/src/source_analyzer.rs')
-rw-r--r--crates/hir/src/source_analyzer.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/hir/src/source_analyzer.rs b/crates/hir/src/source_analyzer.rs
index bed3fa50f..dc21f6051 100644
--- a/crates/hir/src/source_analyzer.rs
+++ b/crates/hir/src/source_analyzer.rs
@@ -28,8 +28,9 @@ use syntax::{
28}; 28};
29 29
30use crate::{ 30use crate::{
31 db::HirDatabase, semantics::PathResolution, Adt, Const, Field, Function, Local, MacroDef, 31 code_model::BuiltinType, db::HirDatabase, semantics::PathResolution, Adt, Const, Field,
32 ModuleDef, Static, Struct, Trait, Type, TypeAlias, TypeParam, Variant, 32 Function, Local, MacroDef, ModuleDef, Static, Struct, Trait, Type, TypeAlias, TypeParam,
33 Variant,
33}; 34};
34use base_db::CrateId; 35use base_db::CrateId;
35 36
@@ -479,7 +480,7 @@ fn resolve_hir_path_(
479 } 480 }
480 TypeNs::EnumVariantId(it) => PathResolution::Def(Variant::from(it).into()), 481 TypeNs::EnumVariantId(it) => PathResolution::Def(Variant::from(it).into()),
481 TypeNs::TypeAliasId(it) => PathResolution::Def(TypeAlias::from(it).into()), 482 TypeNs::TypeAliasId(it) => PathResolution::Def(TypeAlias::from(it).into()),
482 TypeNs::BuiltinType(it) => PathResolution::Def(it.into()), 483 TypeNs::BuiltinType(it) => PathResolution::Def(BuiltinType::from(it).into()),
483 TypeNs::TraitId(it) => PathResolution::Def(Trait::from(it).into()), 484 TypeNs::TraitId(it) => PathResolution::Def(Trait::from(it).into()),
484 }) 485 })
485 }; 486 };
@@ -555,7 +556,7 @@ fn resolve_hir_path_qualifier(
555 TypeNs::AdtSelfType(it) | TypeNs::AdtId(it) => PathResolution::Def(Adt::from(it).into()), 556 TypeNs::AdtSelfType(it) | TypeNs::AdtId(it) => PathResolution::Def(Adt::from(it).into()),
556 TypeNs::EnumVariantId(it) => PathResolution::Def(Variant::from(it).into()), 557 TypeNs::EnumVariantId(it) => PathResolution::Def(Variant::from(it).into()),
557 TypeNs::TypeAliasId(it) => PathResolution::Def(TypeAlias::from(it).into()), 558 TypeNs::TypeAliasId(it) => PathResolution::Def(TypeAlias::from(it).into()),
558 TypeNs::BuiltinType(it) => PathResolution::Def(it.into()), 559 TypeNs::BuiltinType(it) => PathResolution::Def(BuiltinType::from(it).into()),
559 TypeNs::TraitId(it) => PathResolution::Def(Trait::from(it).into()), 560 TypeNs::TraitId(it) => PathResolution::Def(Trait::from(it).into()),
560 }) 561 })
561} 562}