code review fixes

This commit is contained in:
Saleem Jaffer 2019-08-01 12:13:49 +05:30
parent 0c4513e8ed
commit 00d32e8687
2 changed files with 7 additions and 6 deletions

View file

@ -57,11 +57,7 @@ macro_rules! throw_inval {
#[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]

View file

@ -259,6 +259,12 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
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,
@ -267,7 +273,6 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
None,
);
}
_ => {},
}
None
},