From d97d4ebecc502bcb5eda2cdaa513e0e7922a377e Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Fri, 16 Jun 2023 02:10:10 +0000 Subject: Remove even more redundant builtin candidates --- compiler/rustc_const_eval/src/transform/check_consts/check.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_const_eval/src/transform') diff --git a/compiler/rustc_const_eval/src/transform/check_consts/check.rs b/compiler/rustc_const_eval/src/transform/check_consts/check.rs index d4cde7e2c65..106cf111474 100644 --- a/compiler/rustc_const_eval/src/transform/check_consts/check.rs +++ b/compiler/rustc_const_eval/src/transform/check_consts/check.rs @@ -781,7 +781,11 @@ impl<'tcx> Visitor<'tcx> for Checker<'_, 'tcx> { ); return; } - Ok(Some(ImplSource::Closure(_))) => { + // Closure: Fn{Once|Mut} + Ok(Some(ImplSource::Builtin(_))) + if poly_trait_pred.self_ty().skip_binder().is_closure() + && tcx.fn_trait_kind_from_def_id(trait_id).is_some() => + { let ty::Closure(closure_def_id, substs) = *poly_trait_pred.self_ty().no_bound_vars().unwrap().kind() else { -- cgit 1.4.1-3-g733a5