]> git.lizzy.rs Git - rust.git/blob - crates/ra_hir/src/lib.rs
Merge #701
[rust.git] / crates / ra_hir / src / lib.rs
1 //! HIR (previously known as descriptors) provides a high-level object oriented
2 //! access to Rust code.
3 //!
4 //! The principal difference between HIR and syntax trees is that HIR is bound
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.
7
8 macro_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
20 pub mod db;
21 #[cfg(test)]
22 mod mock;
23 mod query_definitions;
24 mod path;
25 pub mod source_binder;
26
27 mod ids;
28 mod macros;
29 mod name;
30 mod module_tree;
31 mod nameres;
32 mod adt;
33 mod type_ref;
34 mod ty;
35 mod impl_block;
36 mod expr;
37 mod generics;
38 mod docs;
39
40 mod code_model_api;
41 mod code_model_impl;
42
43 #[cfg(test)]
44 mod marks;
45
46 use crate::{
47     db::HirDatabase,
48     name::{AsName, KnownName},
49     ids::{SourceItemId, SourceFileItems},
50 };
51
52 pub use self::{
53     path::{Path, PathKind},
54     name::Name,
55     ids::{HirFileId, MacroCallId, MacroCallLoc, HirInterner},
56     macros::{MacroDef, MacroInput, MacroExpansion},
57     nameres::{ItemMap, PerNs, Namespace, Resolution},
58     ty::Ty,
59     impl_block::{ImplBlock, ImplItem},
60     docs::{Docs, Documentation},
61     adt::AdtDef,
62     expr::{ExprScopes, ScopesWithSyntaxMapping},
63 };
64
65 pub use self::code_model_api::{
66     Crate, CrateDependency,
67     Def,
68     Module, ModuleDef, ModuleSource, Problem,
69     Struct, Enum, EnumVariant,
70     Function, FnSignature, ScopeEntryWithSyntax,
71     StructField, FieldSource,
72     Static, Const,
73     Trait, Type,
74 };