macro_rules! error {
($diagnostic:expr) => { ... };
($diagnostic:expr, $fragment:expr) => { ... };
}Expand description
Macro to create an Error from a diagnostic function call
Usage:
error!(diagnostic_function(args))- Creates an error without fragmenterror!(diagnostic_function(args), fragment)- Creates an error with fragment
Expands to: Error(diagnostic_function(args)) or
Error(diagnostic_function(args).with_fragment(fragment))
Examples:
error!(sequence_exhausted(Type::Uint8))error!(sequence_exhausted(Type::Uint8), fragment)