Macro rune::vm_panic

source ·
macro_rules! vm_panic {
    ($expr:expr) => { ... };
}
Expand description

Helper to cause a panic.

This simply returns a VmResult, but the macro is provided to play nicely with rune::function, since a regular return would otherwise be transformed.

§Examples

use rune::vm_panic;

#[rune::function(vm_result)]
fn hello(panic: bool) {
    if panic {
       vm_panic!("I was told to panic");
    }
}