also add macros for free-form error messages

This commit is contained in:
Ralf Jung 2019-08-03 20:35:52 +02:00
parent a457433456
commit fe08d9e2d2

View File

@ -9,6 +9,11 @@ macro_rules! err_unsup {
};
}
#[macro_export]
macro_rules! err_unsup_format {
($($tt:tt)*) => { err_unsup!(Unsupported(format!($($tt)*))) };
}
#[macro_export]
macro_rules! err_inval {
($($tt:tt)*) => {
@ -27,6 +32,11 @@ macro_rules! err_ub {
};
}
#[macro_export]
macro_rules! err_ub_format {
($($tt:tt)*) => { err_ub!(Ub(format!($($tt)*))) };
}
#[macro_export]
macro_rules! err_panic {
($($tt:tt)*) => {