]> git.lizzy.rs Git - rust.git/blob - crates/ra_hir/src/lib.rs
Replace `ra_hir_expand::either` with crate
[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 debug;
30
31 pub mod db;
32 pub mod source_binder;
33
34 mod ty;
35 pub mod diagnostics;
36
37 mod from_id;
38 mod code_model;
39
40 pub mod from_source;
41
42 pub use crate::{
43     code_model::{
44         src::HasSource, Adt, AssocItem, AttrDef, Const, Container, Crate, CrateDependency,
45         DefWithBody, Docs, Enum, EnumVariant, FieldSource, Function, GenericDef, GenericParam,
46         HasAttrs, ImplBlock, Import, Local, MacroDef, Module, ModuleDef, ModuleSource, ScopeDef,
47         Static, Struct, StructField, Trait, Type, TypeAlias, Union, VariantDef,
48     },
49     from_source::FromSource,
50     source_binder::{PathResolution, ScopeEntryWithSyntax, SourceAnalyzer},
51     ty::{
52         display::HirDisplay,
53         primitive::{FloatBitness, FloatTy, IntBitness, IntTy, Signedness, Uncertain},
54         ApplicationTy, CallableDef, Substs, TraitRef, Ty, TypeCtor, TypeWalk,
55     },
56 };
57
58 pub use hir_def::{
59     body::scope::ExprScopes,
60     builtin_type::BuiltinType,
61     docs::Documentation,
62     path::{Path, PathKind},
63     type_ref::Mutability,
64 };
65 pub use hir_expand::{
66     name::Name, HirFileId, InFile, MacroCallId, MacroCallLoc, MacroDefId, MacroFile,
67 };