ice

Macro ice 

Source
macro_rules! ice {
    ($msg:expr) => { ... };
    ($msg:expr, phase: $phase:expr) => { ... };
    ($msg:expr, details: { $($key:expr => $value:expr),+ $(,)? }) => { ... };
    ($msg:expr, phase: $phase:expr, details: { $($key:expr => $value:expr),+ $(,)? }) => { ... };
}
Expand description

Create an IceContext with automatic version and backtrace capture.

This macro provides a convenient way to create ICE contexts with common defaults while allowing customization of phase and details.

§Syntax

// Just a message
ice!("error message")

// Message + phase
ice!("error message", phase: "codegen/emit")

// Message + details
ice!("error message", details: { "key1" => "value1", "key2" => "value2" })

// Message + phase + details
ice!("error message",
    phase: "sema",
    details: { "expected" => "i32", "found" => "bool" }
)

The macro automatically:

  • Captures a backtrace

Callers should add version information using .with_version() when creating ICEs.