Trait Pass

Source
pub trait Pass {
    type In;
    type Out;
    type Error;

    const NAME: &'static str;

    // Required method
    fn run(
        &mut self,
        input: Self::In,
        cx: &mut PassContext,
    ) -> Result<Self::Out, Self::Error>;
}
Expand description

Generic pass interface for one compiler transformation.

Required Associated Constants§

Source

const NAME: &'static str

Stable pass name used for stats and diagnostics.

Required Associated Types§

Source

type In

Input value consumed by this pass.

Source

type Out

Output value produced by this pass.

Source

type Error

Error type emitted by this pass.

Required Methods§

Source

fn run( &mut self, input: Self::In, cx: &mut PassContext, ) -> Result<Self::Out, Self::Error>

Execute one pass invocation.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> Pass for CheckProgramPass<'a>

Source§

const NAME: &'static str = "check.check_program"

Source§

type In = ()

Source§

type Out = CheckedProgram

Source§

type Error = CheckError

Source§

impl<'a> Pass for ElaborateProgramPass<'a>

Source§

const NAME: &'static str = "elab.elaborate_program"

Source§

type In = ()

Source§

type Out = Program

Source§

type Error = ElabError

Source§

impl<'a> Pass for EmitRustPass<'a>

Source§

const NAME: &'static str = "codegen.rust.emit_program"

Source§

type In = ()

Source§

type Out = String

Source§

type Error = CodegenError

Source§

impl<'a> Pass for EmitWasmPass<'a>

Source§

const NAME: &'static str = "codegen.wasm.emit_program"

Source§

type In = ()

Source§

type Out = WasmArtifacts

Source§

type Error = Infallible

Source§

impl<'a> Pass for ExpandProgramPass<'a>

Source§

const NAME: &'static str = "meta.expand_program"

Source§

type In = ()

Source§

type Out = Program

Source§

type Error = MetaEvalError

Source§

impl<'a> Pass for LowerHirPass<'a>

Source§

const NAME: &'static str = "hir.lower_program"

Source§

type In = ()

Source§

type Out = HirProgram

Source§

type Error = Infallible

Source§

impl<'a> Pass for LowerMirPass<'a>

Source§

const NAME: &'static str = "mir.lower_program"

Source§

type In = ()

Source§

type Out = MirProgram

Source§

type Error = LowerError

Source§

impl<'a> Pass for BindTemplateCallArgsPass<'a>

Source§

const NAME: &'static str = "elab.bind_template_call_args"

Source§

type In = Vec<CallArg>

Source§

type Out = TemplateCallBinding

Source§

type Error = ElabError

Source§

impl<'a> Pass for InstantiateRuntimeFunctionPass<'a>

Source§

const NAME: &'static str = "elab.instantiate_runtime_function"

Source§

type In = ()

Source§

type Out = String

Source§

type Error = ElabError

Source§

impl<'a> Pass for NormalizeRuntimeCallsAndSpreadsPass<'a>

Source§

const NAME: &'static str = "elab.normalize_runtime_calls_and_spreads"

Source§

type In = Vec<CallArg>

Source§

type Out = Vec<CallArg>

Source§

type Error = ElabError

Source§

impl<'a> Pass for ValidateRuntimeCallArgsPass<'a>

Source§

const NAME: &'static str = "elab.validate_runtime_call_args"

Source§

type In = Vec<CallArg>

Source§

type Out = Vec<CallArg>

Source§

type Error = ElabError