]> git.lizzy.rs Git - rust.git/blob - crates/ra_hir/src/lib.rs
0008a8858fc44a45813fe5f96830c90594c2c6c4
[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 #![recursion_limit = "512"]
9
10 macro_rules! impl_froms {
11     ($e:ident: $($v:ident $(($($sv:ident),*))?),*) => {
12         $(
13             impl From<$v> for $e {
14                 fn from(it: $v) -> $e {
15                     $e::$v(it)
16                 }
17             }
18             $($(
19                 impl From<$sv> for $e {
20                     fn from(it: $sv) -> $e {
21                         $e::$v($v::$sv(it))
22                     }
23                 }
24             )*)?
25         )*
26     }
27 }
28
29 pub mod db;
30 pub mod source_binder;
31
32 pub mod diagnostics;
33
34 mod from_id;
35 mod code_model;
36
37 mod has_source;
38 mod from_source;
39
40 pub use crate::{
41     code_model::{
42         Adt, AssocItem, AttrDef, Const, Crate, CrateDependency, DefWithBody, Docs, Enum,
43         EnumVariant, FieldSource, Function, GenericDef, HasAttrs, ImplBlock, Local, MacroDef,
44         Module, ModuleDef, ScopeDef, Static, Struct, StructField, Trait, Type, TypeAlias,
45         TypeParam, Union, VariantDef,
46     },
47     from_source::FromSource,
48     has_source::HasSource,
49     source_binder::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer},
50 };
51
52 pub use hir_def::{
53     body::scope::ExprScopes,
54     builtin_type::BuiltinType,
55     docs::Documentation,
56     nameres::ModuleSource,
57     path::{ModPath, Path, PathKind},
58     type_ref::Mutability,
59 };
60 pub use hir_expand::{
61     name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile, Origin,
62 };
63 pub use hir_ty::{display::HirDisplay, CallableDef};