@@ -32,32 +32,12 @@ pub fn is_min_const_fn<'a, 'tcx>(tcx: TyCtxt<'tcx>, body: &'a Body<'tcx>, msrv:
32
32
| ty:: PredicateKind :: Projection ( _)
33
33
| ty:: PredicateKind :: ConstEvaluatable ( ..)
34
34
| ty:: PredicateKind :: ConstEquate ( ..)
35
+ | ty:: PredicateKind :: Trait ( ..)
35
36
| ty:: PredicateKind :: TypeWellFormedFromEnv ( ..) => continue ,
36
37
ty:: PredicateKind :: ObjectSafe ( _) => panic ! ( "object safe predicate on function: {:#?}" , predicate) ,
37
38
ty:: PredicateKind :: ClosureKind ( ..) => panic ! ( "closure kind predicate on function: {:#?}" , predicate) ,
38
39
ty:: PredicateKind :: Subtype ( _) => panic ! ( "subtype predicate on function: {:#?}" , predicate) ,
39
40
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
- } ,
61
41
}
62
42
}
63
43
match predicates. parent {
0 commit comments