[][src]Crate mun_hir

HIR provides high-level, object-oriented access to Mun code. It is constructed by first parsing Mun code with the mun_syntax crate and then it is lowered into HIR constructs, names are resolved, and type checking is performed. HIR is the input for both the compiler as well as the language server.

Re-exports

pub use salsa;

Modules

diagnostics
line_index

Macros

name
ty_app

Structs

ApplicationTy

A nominal type with (maybe 0) type parameters. This might be a primitive type like bool, a struct, tuple, function pointer, reference or several other things.

Body

The body of an item (function, const etc.).

DefDatabaseStorage

Representative struct for the query group.

ExprId
ExprScopes
FileId

FileId is an integer which uniquely identifies a file. File paths are messy and system-dependent, so most of the code should work directly with FileId, without inspecting the path. The mapping between FileId and path and SourceRoot is constant. A file rename is represented as a pair of deletion/creation.

FloatTy
FnData
Function
HirDatabaseStorage

Representative struct for the query group.

InferenceResult

The result of type inference: A mapping from expressions and patterns to types.

IntTy
ItemLoc
Module
Name

Name is a wrapper around string, which is used in hir for both references and declarations.

PatId
Path
PerNs
RawId
RawItems

RawItems are top level file items. RawItems do not change on most edits.

RecordLitField
RelativePath

A borrowed, immutable relative path.

RelativePathBuf

An owned, mutable relative path.

Resolver
SourceDatabaseStorage

Representative struct for the query group.

SourceRoot
SourceRootId

Files are grouped into source roots. A source root is a directory on the file systems which is watched for changes. Typically it corresponds to a single library.

Struct

Enums

ArithOp
BinaryOp
CallableDef
CmpOp
Expr
FloatBitness
IntBitness
Literal
LogicOp
ModuleDef
Ordering
Pat

Similar to ast::PatKind

PathKind
Resolution
Signedness
Statement
StructMemoryKind

Represents the kind of memory management a struct uses.

Ty

This should be cheap to clone.

TypeCtor

A type constructor or type name: this might be something like the primitive type bool, a struct like Vec, or things like function pointers or tuples.

UnaryOp
Visibility

Traits

ArenaId

Enables storing in an Arena.

DefDatabase
HirDatabase
HirDisplay
ResolveBitness
SourceDatabase

Database which stores all significant input facts: source code and project model. Everything else in rust-analyzer is derived from these queries.

Functions

resolver_for_expr