rustc_middle

Macro span_bug

Source
macro_rules! span_bug {
    ($span:expr, $msg:expr) => { ... };
    ($span:expr, $msg:expr,) => { ... };
    ($span:expr, $fmt:expr, $($arg:tt)+) => { ... };
}
Expand description

A macro for triggering an ICE with a span. Calling span_bug! instead of panicking will result in a nicer error message and point at the code the compiler was compiling when it ICEd. This is the preferred way to trigger ICEs.

If the bug should only be emitted when compilation didn’t fail, DiagCtxtHandle::span_delayed_bug may be useful.