From 5a496aab03d2e3ba9ce1bb1bd0b791c83513d2cb Mon Sep 17 00:00:00 2001 From: Boxy Date: Tue, 22 Nov 2022 12:22:36 +0000 Subject: [PATCH] dont skip const evalautable of non unevaluateds --- .../rustc_trait_selection/src/traits/const_evaluatable.rs | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs index a2f82841e40..42d50b68c6d 100644 --- a/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs +++ b/compiler/rustc_trait_selection/src/traits/const_evaluatable.rs @@ -157,12 +157,7 @@ fn visit_const(&mut self, c: ty::Const<'tcx>) -> ControlFlow { 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);