Module mun_hir::semantics

source ·
Expand description

Semantics provides the means to get semantic information from syntax trees that are not necessarily part of the compilation process. This is useful when you want to extract information from a modified source file in the context of the current state.

Our compilation databases (e.g. HirDatabase) provides a lot of steps to go from a syntax tree (as provided by the mun_syntax::ast module) to more abstract representations of the source through the process of lowering. However, for IDE purposes we often want to cut through all this and go from source locations straight to lowered data structures and back. This is what Semantics enables.

Structs

A local variable in a body
The primary API to get semantic information, like types, from syntax trees. Exposes the database it was created with through the db field.
Represents the notion of a scope (set of possible names) at a particular position in source.

Enums

Represents an element in a scope