@@ -452,26 +452,16 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
452
452
predicate,
453
453
) ) ;
454
454
}
455
- ty:: ConstKind :: Infer ( infer) => {
456
- let resolved = self . infcx . shallow_resolve ( infer) ;
457
- // the `InferConst` changed, meaning that we made progress.
458
- if resolved != infer {
459
- let cause = self . cause ( traits:: WellFormed ( None ) ) ;
460
-
461
- let resolved_constant = self . infcx . tcx . mk_const ( ty:: ConstS {
462
- kind : ty:: ConstKind :: Infer ( resolved) ,
463
- ty : constant. ty ( ) ,
464
- } ) ;
465
- self . out . push ( traits:: Obligation :: with_depth (
466
- cause,
467
- self . recursion_depth ,
468
- self . param_env ,
469
- ty:: Binder :: dummy ( ty:: PredicateKind :: WellFormed (
470
- resolved_constant. into ( ) ,
471
- ) )
455
+ ty:: ConstKind :: Infer ( _) => {
456
+ let cause = self . cause ( traits:: WellFormed ( None ) ) ;
457
+
458
+ self . out . push ( traits:: Obligation :: with_depth (
459
+ cause,
460
+ self . recursion_depth ,
461
+ self . param_env ,
462
+ ty:: Binder :: dummy ( ty:: PredicateKind :: WellFormed ( constant. into ( ) ) )
472
463
. to_predicate ( self . tcx ( ) ) ,
473
- ) ) ;
474
- }
464
+ ) ) ;
475
465
}
476
466
ty:: ConstKind :: Error ( _)
477
467
| ty:: ConstKind :: Param ( _)
@@ -675,22 +665,14 @@ impl<'a, 'tcx> WfPredicates<'a, 'tcx> {
675
665
// See also the comment on `fn obligations`, describing "livelock"
676
666
// prevention, which happens before this can be reached.
677
667
ty:: Infer ( _) => {
678
- let ty = self . infcx . shallow_resolve ( ty) ;
679
- if let ty:: Infer ( ty:: TyVar ( _) ) = ty. kind ( ) {
680
- // Not yet resolved, but we've made progress.
681
- let cause = self . cause ( traits:: WellFormed ( None ) ) ;
682
- self . out . push ( traits:: Obligation :: with_depth (
683
- cause,
684
- self . recursion_depth ,
685
- param_env,
686
- ty:: Binder :: dummy ( ty:: PredicateKind :: WellFormed ( ty. into ( ) ) )
687
- . to_predicate ( self . tcx ( ) ) ,
688
- ) ) ;
689
- } else {
690
- // Yes, resolved, proceed with the result.
691
- // FIXME(eddyb) add the type to `walker` instead of recursing.
692
- self . compute ( ty. into ( ) ) ;
693
- }
668
+ let cause = self . cause ( traits:: WellFormed ( None ) ) ;
669
+ self . out . push ( traits:: Obligation :: with_depth (
670
+ cause,
671
+ self . recursion_depth ,
672
+ param_env,
673
+ ty:: Binder :: dummy ( ty:: PredicateKind :: WellFormed ( ty. into ( ) ) )
674
+ . to_predicate ( self . tcx ( ) ) ,
675
+ ) ) ;
694
676
}
695
677
}
696
678
}
0 commit comments