Skip to content

Commit b86620d

Browse files
committed
Stabilize const_fn_fn_ptr_basics and const_fn_trait_bound
1 parent 96eb116 commit b86620d

File tree

1 file changed

+1
-21
lines changed

1 file changed

+1
-21
lines changed

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 1 addition & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -32,32 +32,12 @@ pub fn is_min_const_fn<'a, 'tcx>(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, msrv:
3232
| ty::PredicateKind::Projection(_)
3333
| ty::PredicateKind::ConstEvaluatable(..)
3434
| ty::PredicateKind::ConstEquate(..)
35+
| ty::PredicateKind::Trait(..)
3536
| ty::PredicateKind::TypeWellFormedFromEnv(..) => continue,
3637
ty::PredicateKind::ObjectSafe(_) => panic!("object safe predicate on function: {:#?}", predicate),
3738
ty::PredicateKind::ClosureKind(..) => panic!("closure kind predicate on function: {:#?}", predicate),
3839
ty::PredicateKind::Subtype(_) => panic!("subtype predicate on function: {:#?}", predicate),
3940
ty::PredicateKind::Coerce(_) => panic!("coerce predicate on function: {:#?}", predicate),
40-
ty::PredicateKind::Trait(pred) => {
41-
if Some(pred.def_id()) == tcx.lang_items().sized_trait() {
42-
continue;
43-
}
44-
match pred.self_ty().kind() {
45-
ty::Param(ref p) => {
46-
let generics = tcx.generics_of(current);
47-
let def = generics.type_param(p, tcx);
48-
let span = tcx.def_span(def.def_id);
49-
return Err((
50-
span,
51-
"trait bounds other than `Sized` \
52-
on const fn parameters are unstable"
53-
.into(),
54-
));
55-
},
56-
// other kinds of bounds are either tautologies
57-
// or cause errors in other passes
58-
_ => continue,
59-
}
60-
},
6141
}
6242
}
6343
match predicates.parent {

0 commit comments

Comments
 (0)