Skip to content

Commit 00d32e8

Browse files
committed
code review fixes
1 parent 0c4513e commit 00d32e8

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

src/librustc/mir/interpret/mod.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,7 @@ macro_rules! throw_inval {
5757

5858
#[macro_export]
5959
macro_rules! throw_ub {
60-
($($tt:tt)*) => {
61-
return Err($crate::mir::interpret::InterpError::UndefinedBehaviour(
62-
$crate::mir::interpret::UndefinedBehaviourInfo::$($tt)*
63-
).into())
64-
};
60+
($($tt:tt)*) => { return Err(err_ub!($($tt)*).into()) };
6561
}
6662

6763
#[macro_export]

src/librustc_mir/transform/const_prop.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,12 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
259259
use rustc::mir::interpret::InterpError::*;
260260
match diagnostic.error {
261261
Exit(_) => bug!("the CTFE program cannot exit"),
262+
Unsupported(_)
263+
| UndefinedBehaviour(_)
264+
| InvalidProgram(_)
265+
| ResourceExhaustion(_) => {
266+
// Ignore these errors.
267+
}
262268
Panic(_) => {
263269
diagnostic.report_as_lint(
264270
self.ecx.tcx,
@@ -267,7 +273,6 @@ impl<'mir, 'tcx> ConstPropagator<'mir, 'tcx> {
267273
None,
268274
);
269275
}
270-
_ => {},
271276
}
272277
None
273278
},

0 commit comments

Comments
 (0)