Expand description
Implementation of lint checking.
The lint checking is mostly consolidated into one pass which runs
after all other analyses. Throughout compilation, lint warnings
can be added via the add_lint
method on the Session structure. This
requires a span and an ID of the node that the lint is being added to. The
lint isnβt actually emitted at that time because it is unknown what the
actual lint level at that location is.
To actually emit lint warnings/errors, a separate pass is used. A context keeps track of the current state of all lint levels. Upon entering a node of the ast which can modify the lint settings, the previous lint state is pushed onto a stack and the ast is then recursed upon. As the ast is traversed, this keeps track of the current lint level for all lint attributes.
Modules§
- diagnostics π
Structs§
- Context for lint checking of the AST, after expansion, before lowering to HIR.
- Context for lint checking outside of type inference.
- Lint
Alias π - Lint
Group π - Information about the registered lints.
Enums§
- Target
Lint πThe target of theby_name
map, which accounts for renaming/deprecation.
Traits§
Type Aliases§
- Early
Lint πPass Factory - Late
Lint πPass Factory