@@ -230,8 +230,6 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
230230 }
231231 }
232232
233- self . check_item_predicates ( ) ;
234-
235233 for ( idx, local) in body. local_decls . iter_enumerated ( ) {
236234 // Handle the return place below.
237235 if idx == RETURN_PLACE || local. internal {
@@ -364,40 +362,6 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
364362 }
365363 }
366364
367- fn check_item_predicates ( & mut self ) {
368- let ConstCx { tcx, .. } = * self . ccx ;
369-
370- let mut current = self . def_id ( ) . to_def_id ( ) ;
371- loop {
372- let predicates = tcx. predicates_of ( current) ;
373- for ( predicate, _) in predicates. predicates {
374- match predicate. kind ( ) . skip_binder ( ) {
375- ty:: PredicateKind :: RegionOutlives ( _)
376- | ty:: PredicateKind :: TypeOutlives ( _)
377- | ty:: PredicateKind :: WellFormed ( _)
378- | ty:: PredicateKind :: Projection ( _)
379- | ty:: PredicateKind :: ConstEvaluatable ( ..)
380- | ty:: PredicateKind :: ConstEquate ( ..)
381- | ty:: PredicateKind :: Trait ( ..)
382- | ty:: PredicateKind :: TypeWellFormedFromEnv ( ..) => continue ,
383- ty:: PredicateKind :: ObjectSafe ( _) => {
384- bug ! ( "object safe predicate on function: {:#?}" , predicate)
385- }
386- ty:: PredicateKind :: ClosureKind ( ..) => {
387- bug ! ( "closure kind predicate on function: {:#?}" , predicate)
388- }
389- ty:: PredicateKind :: Subtype ( _) | ty:: PredicateKind :: Coerce ( _) => {
390- bug ! ( "subtype/coerce predicate on function: {:#?}" , predicate)
391- }
392- }
393- }
394- match predicates. parent {
395- Some ( parent) => current = parent,
396- None => break ,
397- }
398- }
399- }
400-
401365 fn check_mut_borrow ( & mut self , local : Local , kind : hir:: BorrowKind ) {
402366 match self . const_kind ( ) {
403367 // In a const fn all borrows are transient or point to the places given via
0 commit comments