Crate ra_ap_hir[−][src]
Expand description
HIR (previously known as descriptors) provides a high-level object oriented access to Rust code.
The principal difference between HIR and syntax trees is that HIR is bound to a particular crate instance. That is, it has cfg flags and features applied. So, the relation between syntax and HIR is many-to-one.
HIR is the public API of the all of the compiler logic above syntax trees. It is written in “OO” style. Each type is self contained (as in, it knows it’s parents and full context). It should be “clean code”.
hir_*
crates are the implementation of the compiler logic.
They are written in “ECS” style, with relatively little abstractions.
Many types are not self-contained, and explicitly use local indexes, arenas, etc.
hir
is what insulates the “we don’t know how to actually write an incremental compiler”
from the ide with completions, hovers, etc. It is a (soft, internal) boundary:
https://www.tedinski.com/2018/02/06/system-boundaries.html.
Re-exports
pub use crate::diagnostics::AnyDiagnostic; | |
pub use crate::diagnostics::BreakOutsideOfLoop; | |
pub use crate::diagnostics::InactiveCode; | |
pub use crate::diagnostics::MacroError; | |
pub use crate::diagnostics::MismatchedArgCount; | |
pub use crate::diagnostics::MissingFields; | |
pub use crate::diagnostics::MissingMatchArms; | |
pub use crate::diagnostics::MissingOkOrSomeInTailExpr; | |
pub use crate::diagnostics::MissingUnsafe; | |
pub use crate::diagnostics::NoSuchField; | |
pub use crate::diagnostics::RemoveThisSemicolon; | |
pub use crate::diagnostics::ReplaceFilterMapNextWithFindMap; | |
pub use crate::diagnostics::UnimplementedBuiltinMacro; | |
pub use crate::diagnostics::UnresolvedExternCrate; | |
pub use crate::diagnostics::UnresolvedImport; | |
pub use crate::diagnostics::UnresolvedMacroCall; | |
pub use crate::diagnostics::UnresolvedModule; | |
pub use crate::diagnostics::UnresolvedProcMacro; |
Modules
db | Re-exports various subcrates databases so that the calling code can depend
only on |
diagnostics | Re-export diagnostics such that clients of |
import_map | A map of all publicly exported items in a crate. |
known |
Structs
Attr | |
Attrs | |
AttrsWithOwner | |
BuiltinType | |
Callable | |
CfgOptions | Configuration options used for conditional compilation on items with |
Const | |
ConstParam | |
Crate | hir::Crate describes a single crate. It’s the main interface with which a crate’s dependencies interact. Mostly, it should be just a proxy for the root module. |
CrateDependency | |
Documentation | Holds documentation |
Enum | |
ExpandResult | |
ExprScopes | |
Field | |
Function | |
HirFileId | Input to the analyzer is a set of files, where each file is identified by
|
Impl | |
InFile |
|
IncorrectCase | |
Label | |
LifetimeParam | |
Local | |
MacroCallId |
|
MacroCallLoc | |
MacroDef | |
MacroDefId | |
MacroFile | |
ModPath | |
Module | |
Name |
|
Param | |
SelfParam | |
Semantics | Primary API to get semantic information, like types, from syntax trees. |
SemanticsScope |
|
Static | |
Struct | |
Trait | |
Type | |
TypeAlias | |
TypeParam | |
Union | |
Variant |
Enums
Access | |
Adt | A Data Type |
AssocItem | Invariant: |
AssocItemContainer | |
CallableKind | |
CfgAtom | A simple configuration value passed in from the outside. |
CfgExpr | |
DefWithBody | The defs which have a body. |
FieldSource | |
GenericDef | |
GenericParam | |
ItemInNs | |
MacroKind | |
ModuleDef | The defs which can be visible in the module. |
ModuleSource | |
Mutability | |
Namespace | |
Origin | |
PathKind | |
PathResolution | |
PrefixKind | |
ScopeDef | For IDE only |
StructKind | |
TypeRef | Compare ty::Ty |
VariantDef | |
Visibility | Visibility of an item, with the path resolved. |
Traits
AsAssocItem | |
HasAttrs | |
HasSource | |
HasVisibility | |
HirDisplay |