This macro is meant to be a
panic! drop-in replacement so its syntax is very similar to
but it has three forms instead of two:
- "panic-format-like" form: span, formatting
strliteral, comma-separated list of args. First argument is a span, all the rest gets passed to
format!to build the error message.
- "panic-single-arg-like" form: span, expr, no comma at the end.
First argument is a span, the second is our error message, it must implement
- "MacroError::trigger-like" form: single expr.
MacroError::from(arg).trigger(). It's here just for convenience so
span_error!can be used with instances of
Stringand so on...