]> git.lizzy.rs Git - rust.git/blob - crates/ra_hir/src/lib.rs
envapsulate navigation target better
[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! ctry {
9     ($expr:expr) => {
10         match $expr {
11             None => return Ok(None),
12             Some(it) => it,
13         }
14     };
15 }
16
17 pub mod db;
18 #[cfg(test)]
19 mod mock;
20 #[macro_use]
21 mod marks;
22 mod query_definitions;
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
37 mod code_model_api;
38 mod code_model_impl;
39
40 use crate::{
41     db::HirDatabase,
42     name::{AsName, KnownName},
43     ids::{DefKind, SourceItemId, SourceFileItemId, SourceFileItems},
44 };
45
46 pub use self::{
47     path::{Path, PathKind},
48     name::Name,
49     ids::{HirFileId, DefId, DefLoc, MacroCallId, MacroCallLoc},
50     macros::{MacroDef, MacroInput, MacroExpansion},
51     nameres::{ItemMap, PerNs, Namespace, Resolution},
52     ty::Ty,
53     impl_block::{ImplBlock, ImplItem},
54     code_model_impl::function::{FnScopes, ScopesWithSyntaxMapping},
55 };
56
57 pub use self::code_model_api::{
58     Crate, CrateDependency,
59     Def,
60     Module, ModuleSource, Problem,
61     Struct, Enum, EnumVariant,
62     Function, FnSignature, ScopeEntryWithSyntax,
63 };