mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 04:19:13 +00:00
Refactor a bit to prepare for resolving trait assoc items
This commit is contained in:
parent
913ab1ec0a
commit
828d60574f
10 changed files with 85 additions and 54 deletions
|
@ -50,7 +50,7 @@ pub(crate) enum Scope {
|
|||
ExprScope(ExprScope),
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq, Eq)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum TypeNs {
|
||||
SelfType(ImplBlock),
|
||||
GenericParam(u32),
|
||||
|
@ -59,19 +59,19 @@ pub enum TypeNs {
|
|||
TypeAlias(TypeAlias),
|
||||
BuiltinType(BuiltinType),
|
||||
Trait(Trait),
|
||||
// Module belong to type ns, but the resovler is used when all module paths
|
||||
// Module belong to type ns, but the resolver is used when all module paths
|
||||
// are fully resolved.
|
||||
// Module(Module)
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum ResolveValueResult<'a> {
|
||||
ValueNs(ValueNs),
|
||||
Partial(TypeNs, usize),
|
||||
TypeRef(&'a TypeRef),
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
#[derive(Debug, Clone, PartialEq, Eq, Hash)]
|
||||
pub enum ValueNs {
|
||||
LocalBinding(PatId),
|
||||
Function(Function),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue