dont skip const evalautable of non unevaluateds

This commit is contained in:
Boxy 2022-11-22 12:22:36 +00:00 committed by kadmin
parent e58b932daf
commit 5a496aab03

View File

@ -157,12 +157,7 @@ fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow<Self::BreakTy> {
for pred in param_env.caller_bounds() {
match pred.kind().skip_binder() {
ty::PredicateKind::ConstEvaluatable(ce) => {
let ty::ConstKind::Unevaluated(_) = ce.kind() else {
continue
};
let Some(b_ct) = tcx.expand_abstract_consts(ce)? else {
continue
};
let b_ct = tcx.expand_abstract_consts(ce)?.unwrap_or(ce);
let mut v = Visitor { ct, infcx, param_env };
let result = b_ct.visit_with(&mut v);