Module ice

Module ice 

Source
Expand description

Internal Compiler Error (ICE) handling.

This module provides rich context capture for internal compiler errors to improve bug reports and developer debugging experience.

§Creating ICEs

Use the [ice!] macro for easy ICE creation:

use gruel_error::ice;

// Simple ICE with just a message
let ctx = ice!("unexpected type in codegen");

// ICE with phase information
let ctx = ice!("invalid instruction", phase: "codegen/emit");

// ICE with custom details
let ctx = ice!("type mismatch",
    phase: "sema",
    details: {
        "expected" => "i32",
        "found" => "bool"
    }
);

// Create a CompileError directly
return Err(ice_error!("codegen failed", phase: "emit"));

Structs§

IceContext
Context information for an Internal Compiler Error (ICE).