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);