diff options
author | Aleksey Kladov <[email protected]> | 2019-01-24 22:32:47 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-01-24 22:32:47 +0000 |
commit | ff9c5bef7b198cde4358610c565cd0b6dc466de5 (patch) | |
tree | 826b309ec9210c03c99534931ba70e6fc715d69e /crates/ra_hir/src/code_model_api.rs | |
parent | 0f2f3a21e7e624f920d182869896347af309e909 (diff) |
ModuleDef is Def-free
Diffstat (limited to 'crates/ra_hir/src/code_model_api.rs')
-rw-r--r-- | crates/ra_hir/src/code_model_api.rs | 11 |
1 files changed, 2 insertions, 9 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>), |