@@ -230,8 +230,6 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
230
230
}
231
231
}
232
232
233
- self . check_item_predicates ( ) ;
234
-
235
233
for ( idx, local) in body. local_decls . iter_enumerated ( ) {
236
234
// Handle the return place below.
237
235
if idx == RETURN_PLACE || local. internal {
@@ -364,40 +362,6 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
364
362
}
365
363
}
366
364
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
-
401
365
fn check_mut_borrow ( & mut self , local : Local , kind : hir:: BorrowKind ) {
402
366
match self . const_kind ( ) {
403
367
// In a const fn all borrows are transient or point to the places given via
0 commit comments