Forward TooGeneric
errors
This commit is contained in:
parent
7fdf06cdde
commit
cce53b3631
1 changed files with 6 additions and 2 deletions
|
@ -24,6 +24,7 @@ use rustc::ty::{self, Ty, TyCtxt, TypeFoldable};
|
||||||
use rustc::ty::query::TyCtxtAt;
|
use rustc::ty::query::TyCtxtAt;
|
||||||
use rustc_data_structures::indexed_vec::IndexVec;
|
use rustc_data_structures::indexed_vec::IndexVec;
|
||||||
use rustc::mir::interpret::{
|
use rustc::mir::interpret::{
|
||||||
|
ErrorHandled,
|
||||||
GlobalId, Scalar, FrameInfo, AllocId,
|
GlobalId, Scalar, FrameInfo, AllocId,
|
||||||
EvalResult, EvalErrorKind,
|
EvalResult, EvalErrorKind,
|
||||||
truncate, sign_extend,
|
truncate, sign_extend,
|
||||||
|
@ -611,8 +612,11 @@ impl<'a, 'mir, 'tcx: 'mir, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tc
|
||||||
} else {
|
} else {
|
||||||
self.param_env
|
self.param_env
|
||||||
};
|
};
|
||||||
self.tcx.const_eval(param_env.and(gid)).map_err(|_| {
|
self.tcx.const_eval(param_env.and(gid)).map_err(|err| {
|
||||||
EvalErrorKind::ReferencedConstant.into()
|
match err {
|
||||||
|
ErrorHandled::Reported => EvalErrorKind::ReferencedConstant.into(),
|
||||||
|
ErrorHandled::TooGeneric => EvalErrorKind::TooGeneric.into(),
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue