#[macro_export]
macro_rules! throw_ub {
- ($($tt:tt)*) => {
- return Err($crate::mir::interpret::InterpError::UndefinedBehaviour(
- $crate::mir::interpret::UndefinedBehaviourInfo::$($tt)*
- ).into())
- };
+ ($($tt:tt)*) => { return Err(err_ub!($($tt)*).into()) };
}
#[macro_export]
use rustc::mir::interpret::InterpError::*;
match diagnostic.error {
Exit(_) => bug!("the CTFE program cannot exit"),
+ Unsupported(_)
+ | UndefinedBehaviour(_)
+ | InvalidProgram(_)
+ | ResourceExhaustion(_) => {
+ // Ignore these errors.
+ }
Panic(_) => {
diagnostic.report_as_lint(
self.ecx.tcx,
None,
);
}
- _ => {},
}
None
},