Don't panic on reported const eval errors
This commit is contained in:
parent
2a082209a6
commit
fed3b26563
1 changed files with 4 additions and 1 deletions
|
|
@ -85,7 +85,10 @@ pub fn force_eval_const<'tcx>(
|
|||
match const_.val {
|
||||
ConstKind::Unevaluated(def_id, ref substs) => {
|
||||
let substs = fx.monomorphize(substs);
|
||||
fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), def_id, substs, None).unwrap()
|
||||
fx.tcx.const_eval_resolve(ParamEnv::reveal_all(), def_id, substs, None).unwrap_or_else(|_| {
|
||||
fx.tcx.sess.abort_if_errors();
|
||||
unreachable!();
|
||||
})
|
||||
}
|
||||
_ => fx.monomorphize(&const_),
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue