salsa/components/salsa-macro-rules/src/unexpected_cycle_recovery.rs
2024-07-13 07:56:14 -04:00

13 lines
487 B
Rust

// Macro that generates the body of the cycle recovery function
// for the case where no cycle recovery is possible. This has to be
// a macro because it can take a variadic number of arguments.
#[macro_export]
macro_rules! unexpected_cycle_recovery {
($db:ident, $cycle:ident, $($other_inputs:ident),*) => {
{
std::mem::drop($db);
std::mem::drop(($($other_inputs),*));
panic!("cannot recover from cycle `{:?}`", $cycle)
}
}
}