aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/lib.rs')
-rw-r--r--crates/ra_hir/src/lib.rs21
1 files changed, 17 insertions, 4 deletions
diff --git a/crates/ra_hir/src/lib.rs b/crates/ra_hir/src/lib.rs
index 87b5a8b8a..596f9c38c 100644
--- a/crates/ra_hir/src/lib.rs
+++ b/crates/ra_hir/src/lib.rs
@@ -5,6 +5,18 @@
5//! to a particular crate instance. That is, it has cfg flags and features 5//! to a particular crate instance. That is, it has cfg flags and features
6//! applied. So, the relation between syntax and HIR is many-to-one. 6//! applied. So, the relation between syntax and HIR is many-to-one.
7 7
8macro_rules! impl_froms {
9 ($e:ident: $($v:ident), *) => {
10 $(
11 impl From<$v> for $e {
12 fn from(it: $v) -> $e {
13 $e::$v(it)
14 }
15 }
16 )*
17 }
18}
19
8pub mod db; 20pub mod db;
9#[cfg(test)] 21#[cfg(test)]
10mod mock; 22mod mock;
@@ -34,25 +46,26 @@ mod marks;
34use crate::{ 46use crate::{
35 db::HirDatabase, 47 db::HirDatabase,
36 name::{AsName, KnownName}, 48 name::{AsName, KnownName},
37 ids::{DefKind, SourceItemId, SourceFileItems}, 49 ids::{SourceItemId, SourceFileItems},
38}; 50};
39 51
40pub use self::{ 52pub use self::{
41 path::{Path, PathKind}, 53 path::{Path, PathKind},
42 name::Name, 54 name::Name,
43 ids::{HirFileId, DefId, DefLoc, MacroCallId, MacroCallLoc, HirInterner}, 55 ids::{HirFileId, MacroCallId, MacroCallLoc, HirInterner},
44 macros::{MacroDef, MacroInput, MacroExpansion}, 56 macros::{MacroDef, MacroInput, MacroExpansion},
45 nameres::{ItemMap, PerNs, Namespace, Resolution}, 57 nameres::{ItemMap, PerNs, Namespace, Resolution},
46 ty::Ty, 58 ty::Ty,
47 impl_block::{ImplBlock, ImplItem}, 59 impl_block::{ImplBlock, ImplItem},
48 code_model_impl::function::{FnScopes, ScopesWithSyntaxMapping}, 60 code_model_impl::function::{FnScopes, ScopesWithSyntaxMapping},
49 docs::{Docs, Documentation} 61 docs::{Docs, Documentation},
62 adt::AdtDef,
50}; 63};
51 64
52pub use self::code_model_api::{ 65pub use self::code_model_api::{
53 Crate, CrateDependency, 66 Crate, CrateDependency,
54 Def, 67 Def,
55 Module, ModuleSource, Problem, 68 Module, ModuleDef, ModuleSource, Problem,
56 Struct, Enum, EnumVariant, 69 Struct, Enum, EnumVariant,
57 Function, FnSignature, ScopeEntryWithSyntax, 70 Function, FnSignature, ScopeEntryWithSyntax,
58 StructField, 71 StructField,