Move PathResolution

This commit is contained in:
Aleksey Kladov 2020-03-05 11:08:31 +01:00
parent 7b6716e50e
commit 7d873fcfa1
3 changed files with 18 additions and 19 deletions

View file

@ -20,10 +20,23 @@ use crate::{
db::HirDatabase,
semantics::source_to_def::{ChildContainer, SourceToDefCache, SourceToDefCtx},
source_analyzer::{resolve_hir_path, SourceAnalyzer},
Function, HirFileId, InFile, Local, MacroDef, Module, ModuleDef, Name, Origin, Path,
PathResolution, ScopeDef, StructField, Trait, Type, TypeParam, VariantDef,
AssocItem, Function, HirFileId, ImplDef, InFile, Local, MacroDef, Module, ModuleDef, Name,
Origin, Path, ScopeDef, StructField, Trait, Type, TypeParam, VariantDef,
};
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum PathResolution {
/// An item
Def(ModuleDef),
/// A local binding (only value namespace)
Local(Local),
/// A generic parameter
TypeParam(TypeParam),
SelfType(ImplDef),
Macro(MacroDef),
AssocItem(AssocItem),
}
/// Primary API to get semantic information, like types, from syntax trees.
pub struct Semantics<'db, DB> {
pub db: &'db DB,