about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Schneider <github35764891676564198441@oli-obk.de>2018-08-31 10:39:47 +0200
committerOliver Scherer <github35764891676564198441@oli-obk.de>2018-10-25 16:47:34 +0200
commitd34232bcaf6f2bdb3ac17d6025c4c68f9798be0b (patch)
tree83831def288c37ad50416b6919baf1f5d31ce54a
parent6f84d6edf1da310d1022777dadf59b87b78bd8fb (diff)
downloadrust-d34232bcaf6f2bdb3ac17d6025c4c68f9798be0b.tar.gz
rust-d34232bcaf6f2bdb3ac17d6025c4c68f9798be0b.zip
Fix rebase fallout
-rw-r--r--src/librustc_mir/interpret/memory.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/librustc_mir/interpret/memory.rs b/src/librustc_mir/interpret/memory.rs
index b46e914133a..0156872a4da 100644
--- a/src/librustc_mir/interpret/memory.rs
+++ b/src/librustc_mir/interpret/memory.rs
@@ -30,7 +30,7 @@ use syntax::ast::Mutability;
 use super::{
     Pointer, AllocId, Allocation, ConstValue, GlobalId,
     EvalResult, Scalar, EvalErrorKind, AllocType, PointerArithmetic,
-    Machine, MemoryAccess, AllocMap, MayLeak, ScalarMaybeUndef,
+    Machine, MemoryAccess, AllocMap, MayLeak, ScalarMaybeUndef, ErrorHandled,
 };
 
 #[derive(Debug, PartialEq, Eq, Copy, Clone, Hash)]
@@ -370,10 +370,13 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
         };
         // use the raw query here to break validation cycles. Later uses of the static will call the
         // full query anyway
-        tcx.const_eval_raw(ty::ParamEnv::reveal_all().and(gid)).map_err(|_| {
+        tcx.const_eval_raw(ty::ParamEnv::reveal_all().and(gid)).map_err(|err| {
             // no need to report anything, the const_eval call takes care of that for statics
             assert!(tcx.is_static(def_id).is_some());
-            EvalErrorKind::ReferencedConstant.into()
+            match err {
+                ErrorHandled::Reported => EvalErrorKind::ReferencedConstant.into(),
+                ErrorHandled::TooGeneric => EvalErrorKind::TooGeneric.into(),
+            }
         }).map(|const_val| {
             if let ConstValue::ByRef(_, allocation, _) = const_val.val {
                 // We got tcx memory. Let the machine figure out whether and how to