Skip to content

Commit d34232b

Browse files
committed
Fix rebase fallout
1 parent 6f84d6e commit d34232b

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/librustc_mir/interpret/memory.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ use syntax::ast::Mutability;
3030
use super::{
3131
Pointer, AllocId, Allocation, ConstValue, GlobalId,
3232
EvalResult, Scalar, EvalErrorKind, AllocType, PointerArithmetic,
33-
Machine, MemoryAccess, AllocMap, MayLeak, ScalarMaybeUndef,
33+
Machine, MemoryAccess, AllocMap, MayLeak, ScalarMaybeUndef, ErrorHandled,
3434
};
3535

3636
#[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> {
370370
};
371371
// use the raw query here to break validation cycles. Later uses of the static will call the
372372
// full query anyway
373-
tcx.const_eval_raw(ty::ParamEnv::reveal_all().and(gid)).map_err(|_| {
373+
tcx.const_eval_raw(ty::ParamEnv::reveal_all().and(gid)).map_err(|err| {
374374
// no need to report anything, the const_eval call takes care of that for statics
375375
assert!(tcx.is_static(def_id).is_some());
376-
EvalErrorKind::ReferencedConstant.into()
376+
match err {
377+
ErrorHandled::Reported => EvalErrorKind::ReferencedConstant.into(),
378+
ErrorHandled::TooGeneric => EvalErrorKind::TooGeneric.into(),
379+
}
377380
}).map(|const_val| {
378381
if let ConstValue::ByRef(_, allocation, _) = const_val.val {
379382
// We got tcx memory. Let the machine figure out whether and how to

0 commit comments

Comments
 (0)