]> git.lizzy.rs Git - rust.git/blob - crates/ra_hir/src/lib.rs
Rename Type => TypeAlias
[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_alias;
33 mod type_ref;
34 mod ty;
35 mod impl_block;
36 mod expr;
37 mod generics;
38 mod docs;
39 mod resolve;
40
41 mod code_model_api;
42 mod code_model_impl;
43
44 #[cfg(test)]
45 mod marks;
46
47 use crate::{
48     db::{HirDatabase, PersistentHirDatabase},
49     name::{AsName, KnownName},
50     ids::{SourceItemId, SourceFileItems},
51 };
52
53 pub use self::{
54     path::{Path, PathKind},
55     name::Name,
56     ids::{HirFileId, MacroCallId, MacroCallLoc, HirInterner},
57     macros::{MacroDef, MacroInput, MacroExpansion},
58     nameres::{ItemMap, PerNs, Namespace},
59     ty::{Ty, Substs},
60     impl_block::{ImplBlock, ImplItem},
61     docs::{Docs, Documentation},
62     adt::AdtDef,
63     expr::{ExprScopes, ScopesWithSyntaxMapping, ScopeEntryWithSyntax},
64     resolve::{Resolver, Resolution},
65 };
66
67 pub use self::code_model_api::{
68     Crate, CrateDependency,
69     Def,
70     Module, ModuleDef, ModuleSource, Problem,
71     Struct, Enum, EnumVariant,
72     Function, FnSignature,
73     StructField, FieldSource,
74     Static, Const,
75     Trait, TypeAlias,
76 };