diff options
Diffstat (limited to 'crates/ra_hir')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 11 | ||||
-rw-r--r-- | crates/ra_hir/src/ty.rs | 1 |
2 files changed, 2 insertions, 10 deletions
diff --git a/crates/ra_hir/src/code_model_api.rs b/crates/ra_hir/src/code_model_api.rs index e2979617d..6739627b4 100644 --- a/crates/ra_hir/src/code_model_api.rs +++ b/crates/ra_hir/src/code_model_api.rs | |||
@@ -5,7 +5,7 @@ use ra_db::{CrateId, FileId}; | |||
5 | use ra_syntax::{ast::self, TreeArc, SyntaxNode}; | 5 | use ra_syntax::{ast::self, TreeArc, SyntaxNode}; |
6 | 6 | ||
7 | use crate::{ | 7 | use crate::{ |
8 | Name, DefId, Path, PerNs, ScopesWithSyntaxMapping, Ty, HirFileId, | 8 | Name, Path, PerNs, ScopesWithSyntaxMapping, Ty, HirFileId, |
9 | type_ref::TypeRef, | 9 | type_ref::TypeRef, |
10 | nameres::{ModuleScope, lower::ImportId}, | 10 | nameres::{ModuleScope, lower::ImportId}, |
11 | db::HirDatabase, | 11 | db::HirDatabase, |
@@ -62,13 +62,12 @@ pub enum ModuleDef { | |||
62 | Function(Function), | 62 | Function(Function), |
63 | Struct(Struct), | 63 | Struct(Struct), |
64 | Enum(Enum), | 64 | Enum(Enum), |
65 | // Can't be directly declared, but can be imported. | ||
65 | EnumVariant(EnumVariant), | 66 | EnumVariant(EnumVariant), |
66 | Const(Const), | 67 | Const(Const), |
67 | Static(Static), | 68 | Static(Static), |
68 | Trait(Trait), | 69 | Trait(Trait), |
69 | Type(Type), | 70 | Type(Type), |
70 | // Can't be directly declared, but can be imported. | ||
71 | Def(DefId), | ||
72 | } | 71 | } |
73 | impl_froms!( | 72 | impl_froms!( |
74 | ModuleDef: Module, | 73 | ModuleDef: Module, |
@@ -82,12 +81,6 @@ impl_froms!( | |||
82 | Type | 81 | Type |
83 | ); | 82 | ); |
84 | 83 | ||
85 | impl From<DefId> for ModuleDef { | ||
86 | fn from(it: DefId) -> ModuleDef { | ||
87 | ModuleDef::Def(it) | ||
88 | } | ||
89 | } | ||
90 | |||
91 | pub enum ModuleSource { | 84 | pub enum ModuleSource { |
92 | SourceFile(TreeArc<ast::SourceFile>), | 85 | SourceFile(TreeArc<ast::SourceFile>), |
93 | Module(TreeArc<ast::Module>), | 86 | Module(TreeArc<ast::Module>), |
diff --git a/crates/ra_hir/src/ty.rs b/crates/ra_hir/src/ty.rs index 3801e498e..1d5624f8f 100644 --- a/crates/ra_hir/src/ty.rs +++ b/crates/ra_hir/src/ty.rs | |||
@@ -695,7 +695,6 @@ impl From<ModuleDef> for Option<TypableDef> { | |||
695 | ModuleDef::EnumVariant(v) => v.into(), | 695 | ModuleDef::EnumVariant(v) => v.into(), |
696 | ModuleDef::Const(_) | 696 | ModuleDef::Const(_) |
697 | | ModuleDef::Static(_) | 697 | | ModuleDef::Static(_) |
698 | | ModuleDef::Def(_) | ||
699 | | ModuleDef::Module(_) | 698 | | ModuleDef::Module(_) |
700 | | ModuleDef::Trait(_) | 699 | | ModuleDef::Trait(_) |
701 | | ModuleDef::Type(_) => return None, | 700 | | ModuleDef::Type(_) => return None, |