code review fixes
This commit is contained in:
parent
0c4513e8ed
commit
00d32e8687
2 changed files with 7 additions and 6 deletions
|
|
@ -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]
|
||||
|
|
|
|||
|
|
@ -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
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue