diff options
| author | Ralf Jung <post@ralfj.de> | 2019-08-03 20:35:52 +0200 |
|---|---|---|
| committer | Ralf Jung <post@ralfj.de> | 2019-08-03 20:35:52 +0200 |
| commit | fe08d9e2d270d97be5a33a2d505d4a9ea56d258a (patch) | |
| tree | 736a36b5a6f57be9d5ed458f98d4de27e9e02e83 | |
| parent | a45743345659c775b01484574af2818c46a2cb03 (diff) | |
| download | rust-fe08d9e2d270d97be5a33a2d505d4a9ea56d258a.tar.gz rust-fe08d9e2d270d97be5a33a2d505d4a9ea56d258a.zip | |
also add macros for free-form error messages
| -rw-r--r-- | src/librustc/mir/interpret/mod.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs index 65f4c9c47d0..1ec95c29a4a 100644 --- a/src/librustc/mir/interpret/mod.rs +++ b/src/librustc/mir/interpret/mod.rs @@ -10,6 +10,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)*) => { $crate::mir::interpret::InterpError::InvalidProgram( @@ -28,6 +33,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)*) => { $crate::mir::interpret::InterpError::Panic( |
