Skip to content

Commit fe08d9e

Browse files
committed
also add macros for free-form error messages
1 parent a457433 commit fe08d9e

File tree

1 file changed

+10
-0
lines changed
  • src/librustc/mir/interpret

1 file changed

+10
-0
lines changed

src/librustc/mir/interpret/mod.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ macro_rules! err_unsup {
99
};
1010
}
1111

12+
#[macro_export]
13+
macro_rules! err_unsup_format {
14+
($($tt:tt)*) => { err_unsup!(Unsupported(format!($($tt)*))) };
15+
}
16+
1217
#[macro_export]
1318
macro_rules! err_inval {
1419
($($tt:tt)*) => {
@@ -27,6 +32,11 @@ macro_rules! err_ub {
2732
};
2833
}
2934

35+
#[macro_export]
36+
macro_rules! err_ub_format {
37+
($($tt:tt)*) => { err_ub!(Ub(format!($($tt)*))) };
38+
}
39+
3040
#[macro_export]
3141
macro_rules! err_panic {
3242
($($tt:tt)*) => {

0 commit comments

Comments
 (0)