]> git.lizzy.rs Git - rust.git/commitdiff
more type annotations to help inference
authorRalf Jung <post@ralfj.de>
Fri, 20 Mar 2020 22:28:01 +0000 (23:28 +0100)
committerRalf Jung <post@ralfj.de>
Fri, 20 Mar 2020 22:28:01 +0000 (23:28 +0100)
src/librustc/mir/interpret/mod.rs

index c5182228e9d1cf04592deeb6b6ffc388d5455f4b..dfe5adb1bbff0ec7183631e5e4b0e207977de9cf 100644 (file)
@@ -49,7 +49,7 @@ macro_rules! err_exhaust {
 // In the `throw_*` macros, avoid `return` to make them work with `try {}`.
 #[macro_export]
 macro_rules! throw_unsup {
-    ($($tt:tt)*) => { Err(err_unsup!($($tt)*))? };
+    ($($tt:tt)*) => { Err::<!, _>(err_unsup!($($tt)*))? };
 }
 
 #[macro_export]
@@ -59,12 +59,12 @@ macro_rules! throw_unsup_format {
 
 #[macro_export]
 macro_rules! throw_inval {
-    ($($tt:tt)*) => { Err(err_inval!($($tt)*))? };
+    ($($tt:tt)*) => { Err::<!, _>(err_inval!($($tt)*))? };
 }
 
 #[macro_export]
 macro_rules! throw_ub {
-    ($($tt:tt)*) => { Err(err_ub!($($tt)*))? };
+    ($($tt:tt)*) => { Err::<!, _>(err_ub!($($tt)*))? };
 }
 
 #[macro_export]
@@ -74,13 +74,13 @@ macro_rules! throw_ub_format {
 
 #[macro_export]
 macro_rules! throw_exhaust {
-    ($($tt:tt)*) => { Err(err_exhaust!($($tt)*))? };
+    ($($tt:tt)*) => { Err::<!, _>(err_exhaust!($($tt)*))? };
 }
 
 #[macro_export]
 macro_rules! throw_machine_stop {
     ($($tt:tt)*) => {
-        Err($crate::mir::interpret::InterpError::MachineStop(Box::new($($tt)*)))?
+        Err::<!, _>($crate::mir::interpret::InterpError::MachineStop(Box::new($($tt)*)))?
     };
 }