Phase

Trait Phase 

Source
pub trait Phase: Send + Sync {
    // Required methods
    fn name(&self) -> &'static str;
    fn description(&self) -> &'static str;
    fn run(&self, ctx: &mut CompilationContext) -> Result<()>;

    // Provided method
    fn info(&self) -> PhaseInfo { ... }
}
Expand description

A phase in the compilation pipeline.

Phases are executed in order by the pipeline. Each phase can read and modify the compilation context, adding to the IR, computed data, or diagnostics.

Built-in phases:

  • ValidatePhase - validates the manifest and collects diagnostics
  • LowerPhase - transforms manifest to Application IR
  • AnalyzePhase - computes shared data from IR

Custom phases can be added to the pipeline for additional processing.

Required Methods§

Source

fn name(&self) -> &'static str

The name of this phase (used in diagnostics and plugin hooks).

Source

fn description(&self) -> &'static str

A human-readable description of what this phase does.

Source

fn run(&self, ctx: &mut CompilationContext) -> Result<()>

Run this phase on the compilation context.

§Errors

Returns an error if the phase fails fatally. Non-fatal issues should be recorded as diagnostics instead.

Provided Methods§

Source

fn info(&self) -> PhaseInfo

Get information about this phase.

Implementors§