From b86620da377102a1a5e84a96910b70c9c957b810 Mon Sep 17 00:00:00 2001 From: Eric Holk Date: Tue, 8 Feb 2022 16:33:15 -0800 Subject: [PATCH] Stabilize const_fn_fn_ptr_basics and const_fn_trait_bound --- clippy_utils/src/qualify_min_const_fn.rs | 22 +--------------------- 1 file changed, 1 insertion(+), 21 deletions(-) diff --git a/clippy_utils/src/qualify_min_const_fn.rs b/clippy_utils/src/qualify_min_const_fn.rs index c039fec95..891531951 100644 --- a/clippy_utils/src/qualify_min_const_fn.rs +++ b/clippy_utils/src/qualify_min_const_fn.rs @@ -32,32 +32,12 @@ pub fn is_min_const_fn<'a, 'tcx>(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, msrv: | ty::PredicateKind::Projection(_) | ty::PredicateKind::ConstEvaluatable(..) | ty::PredicateKind::ConstEquate(..) + | ty::PredicateKind::Trait(..) | ty::PredicateKind::TypeWellFormedFromEnv(..) => continue, ty::PredicateKind::ObjectSafe(_) => panic!("object safe predicate on function: {:#?}", predicate), ty::PredicateKind::ClosureKind(..) => panic!("closure kind predicate on function: {:#?}", predicate), ty::PredicateKind::Subtype(_) => panic!("subtype predicate on function: {:#?}", predicate), ty::PredicateKind::Coerce(_) => panic!("coerce predicate on function: {:#?}", predicate), - ty::PredicateKind::Trait(pred) => { - if Some(pred.def_id()) == tcx.lang_items().sized_trait() { - continue; - } - match pred.self_ty().kind() { - ty::Param(ref p) => { - let generics = tcx.generics_of(current); - let def = generics.type_param(p, tcx); - let span = tcx.def_span(def.def_id); - return Err(( - span, - "trait bounds other than `Sized` \ - on const fn parameters are unstable" - .into(), - )); - }, - // other kinds of bounds are either tautologies - // or cause errors in other passes - _ => continue, - } - }, } } match predicates.parent {