diff options
| author | Saleem Jaffer <ssaleem1992@gmail.com> | 2019-08-01 12:13:49 +0530 |
|---|---|---|
| committer | Saleem Jaffer <ssaleem1992@gmail.com> | 2019-08-01 12:13:49 +0530 |
| commit | 00d32e8687a91f016580e0dee22cec0531ed028b (patch) | |
| tree | e195bfd753fd1c18fdfab777de3a9aad016e16c0 | |
| parent | 0c4513e8ed576050c677763eeb632afbba83dce1 (diff) | |
code review fixes
| -rw-r--r-- | src/librustc/mir/interpret/mod.rs | 6 | ||||
| -rw-r--r-- | src/librustc_mir/transform/const_prop.rs | 7 |
2 files changed, 7 insertions, 6 deletions
diff --git a/src/librustc/mir/interpret/mod.rs b/src/librustc/mir/interpret/mod.rs index f3ed4ffab7d..723a30792fd 100644 --- a/src/librustc/mir/interpret/mod.rs +++ b/src/librustc/mir/interpret/mod.rs @@ -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] diff --git a/src/librustc_mir/transform/const_prop.rs b/src/librustc_mir/transform/const_prop.rs index 5783f53316c..a450ec32e1a 100644 --- a/src/librustc_mir/transform/const_prop.rs +++ b/src/librustc_mir/transform/const_prop.rs @@ -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 }, |
