]> git.lizzy.rs Git - rust.git/blob - crates/ra_hir/src/lib.rs
Merge #891
[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 #[macro_use]
22 pub mod mock;
23 mod path;
24 pub mod source_binder;
25
26 mod ids;
27 mod macros;
28 mod name;
29 mod module_tree;
30 mod nameres;
31 mod adt;
32 mod type_ref;
33 mod ty;
34 mod impl_block;
35 mod expr;
36 mod generics;
37 mod docs;
38 mod resolve;
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, PersistentHirDatabase},
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},
58     ty::Ty,
59     impl_block::{ImplBlock, ImplItem},
60     docs::{Docs, Documentation},
61     adt::AdtDef,
62     expr::{ExprScopes, ScopesWithSyntaxMapping, ScopeEntryWithSyntax},
63     resolve::{Resolver, Resolution},
64 };
65
66 pub use self::code_model_api::{
67     Crate, CrateDependency,
68     Def,
69     Module, ModuleDef, ModuleSource, Problem,
70     Struct, Enum, EnumVariant,
71     Function, FnSignature,
72     StructField, FieldSource,
73     Static, Const,
74     Trait, Type,
75 };