Skip to content

Commit

Permalink
code review fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
saleemjaffer committed Aug 1, 2019
1 parent 0c4513e commit 00d32e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
6 changes: 1 addition & 5 deletions src/librustc/mir/interpret/mod.rs
Expand Up @@ -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]
Expand Down
7 changes: 6 additions & 1 deletion src/librustc_mir/transform/const_prop.rs
Expand Up @@ -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,
Expand All @@ -267,7 +273,6 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
None,
);
}
_ => {},
}
None
},
Expand Down

0 comments on commit 00d32e8

Please sign in to comment.