Skip to content

Commit cce53b3

Browse files
committed
Forward TooGeneric errors
1 parent 7fdf06c commit cce53b3

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/librustc_mir/interpret/eval_context.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
2424
use rustc::ty::query::TyCtxtAt;
2525
use rustc_data_structures::indexed_vec::IndexVec;
2626
use rustc::mir::interpret::{
27+
ErrorHandled,
2728
GlobalId, Scalar, FrameInfo, AllocId,
2829
EvalResult, EvalErrorKind,
2930
truncate, sign_extend,
@@ -611,8 +612,11 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
611612
} else {
612613
self.param_env
613614
};
614-
self.tcx.const_eval(param_env.and(gid)).map_err(|_| {
615-
EvalErrorKind::ReferencedConstant.into()
615+
self.tcx.const_eval(param_env.and(gid)).map_err(|err| {
616+
match err {
617+
ErrorHandled::Reported => EvalErrorKind::ReferencedConstant.into(),
618+
ErrorHandled::TooGeneric => EvalErrorKind::TooGeneric.into(),
619+
}
616620
})
617621
}
618622

0 commit comments

Comments
 (0)