@@ -448,63 +448,53 @@ where
448
448
fn compute_goal ( & mut self , goal : Goal < I , I :: Predicate > ) -> QueryResult < I > {
449
449
let Goal { param_env, predicate } = goal;
450
450
let kind = predicate. kind ( ) ;
451
- if let Some ( kind) = kind. no_bound_vars ( ) {
452
- match kind {
453
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: Trait ( predicate) ) => {
454
- self . compute_trait_goal ( Goal { param_env, predicate } ) . map ( |( r, _via) | r)
455
- }
456
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: HostEffect ( predicate) ) => {
457
- self . compute_host_effect_goal ( Goal { param_env, predicate } )
458
- }
459
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: Projection ( predicate) ) => {
460
- self . compute_projection_goal ( Goal { param_env, predicate } )
461
- }
462
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: TypeOutlives ( predicate) ) => {
463
- self . compute_type_outlives_goal ( Goal { param_env, predicate } )
464
- }
465
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: RegionOutlives ( predicate) ) => {
466
- self . compute_region_outlives_goal ( Goal { param_env, predicate } )
467
- }
468
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: ConstArgHasType ( ct, ty) ) => {
469
- self . compute_const_arg_has_type_goal ( Goal { param_env, predicate : ( ct, ty) } )
470
- }
471
- ty:: PredicateKind :: Subtype ( predicate) => {
472
- self . compute_subtype_goal ( Goal { param_env, predicate } )
473
- }
474
- ty:: PredicateKind :: Coerce ( predicate) => {
475
- self . compute_coerce_goal ( Goal { param_env, predicate } )
476
- }
477
- ty:: PredicateKind :: DynCompatible ( trait_def_id) => {
478
- self . compute_dyn_compatible_goal ( trait_def_id)
479
- }
480
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: WellFormed ( arg) ) => {
481
- self . compute_well_formed_goal ( Goal { param_env, predicate : arg } )
482
- }
483
- ty:: PredicateKind :: Clause ( ty:: ClauseKind :: ConstEvaluatable ( ct) ) => {
484
- self . compute_const_evaluatable_goal ( Goal { param_env, predicate : ct } )
485
- }
486
- ty:: PredicateKind :: ConstEquate ( _, _) => {
487
- panic ! ( "ConstEquate should not be emitted when `-Znext-solver` is active" )
488
- }
489
- ty:: PredicateKind :: NormalizesTo ( predicate) => {
490
- self . compute_normalizes_to_goal ( Goal { param_env, predicate } )
491
- }
492
- ty:: PredicateKind :: AliasRelate ( lhs, rhs, direction) => self
493
- . compute_alias_relate_goal ( Goal {
494
- param_env,
495
- predicate : ( lhs, rhs, direction) ,
496
- } ) ,
497
- ty:: PredicateKind :: Ambiguous => {
498
- self . evaluate_added_goals_and_make_canonical_response ( Certainty :: AMBIGUOUS )
499
- }
451
+ self . enter_forall ( kind, |ecx, kind| match kind {
452
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: Trait ( predicate) ) => {
453
+ ecx. compute_trait_goal ( Goal { param_env, predicate } ) . map ( |( r, _via) | r)
500
454
}
501
- } else {
502
- self . enter_forall ( kind, |ecx, kind| {
503
- let goal = goal. with ( ecx. cx ( ) , ty:: Binder :: dummy ( kind) ) ;
504
- ecx. add_goal ( GoalSource :: InstantiateHigherRanked , goal) ;
505
- ecx. evaluate_added_goals_and_make_canonical_response ( Certainty :: Yes )
506
- } )
507
- }
455
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: HostEffect ( predicate) ) => {
456
+ ecx. compute_host_effect_goal ( Goal { param_env, predicate } )
457
+ }
458
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: Projection ( predicate) ) => {
459
+ ecx. compute_projection_goal ( Goal { param_env, predicate } )
460
+ }
461
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: TypeOutlives ( predicate) ) => {
462
+ ecx. compute_type_outlives_goal ( Goal { param_env, predicate } )
463
+ }
464
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: RegionOutlives ( predicate) ) => {
465
+ ecx. compute_region_outlives_goal ( Goal { param_env, predicate } )
466
+ }
467
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: ConstArgHasType ( ct, ty) ) => {
468
+ ecx. compute_const_arg_has_type_goal ( Goal { param_env, predicate : ( ct, ty) } )
469
+ }
470
+ ty:: PredicateKind :: Subtype ( predicate) => {
471
+ ecx. compute_subtype_goal ( Goal { param_env, predicate } )
472
+ }
473
+ ty:: PredicateKind :: Coerce ( predicate) => {
474
+ ecx. compute_coerce_goal ( Goal { param_env, predicate } )
475
+ }
476
+ ty:: PredicateKind :: DynCompatible ( trait_def_id) => {
477
+ ecx. compute_dyn_compatible_goal ( trait_def_id)
478
+ }
479
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: WellFormed ( arg) ) => {
480
+ ecx. compute_well_formed_goal ( Goal { param_env, predicate : arg } )
481
+ }
482
+ ty:: PredicateKind :: Clause ( ty:: ClauseKind :: ConstEvaluatable ( ct) ) => {
483
+ ecx. compute_const_evaluatable_goal ( Goal { param_env, predicate : ct } )
484
+ }
485
+ ty:: PredicateKind :: ConstEquate ( _, _) => {
486
+ panic ! ( "ConstEquate should not be emitted when `-Znext-solver` is active" )
487
+ }
488
+ ty:: PredicateKind :: NormalizesTo ( predicate) => {
489
+ ecx. compute_normalizes_to_goal ( Goal { param_env, predicate } )
490
+ }
491
+ ty:: PredicateKind :: AliasRelate ( lhs, rhs, direction) => {
492
+ ecx. compute_alias_relate_goal ( Goal { param_env, predicate : ( lhs, rhs, direction) } )
493
+ }
494
+ ty:: PredicateKind :: Ambiguous => {
495
+ ecx. evaluate_added_goals_and_make_canonical_response ( Certainty :: AMBIGUOUS )
496
+ }
497
+ } )
508
498
}
509
499
510
500
// Recursively evaluates all the goals added to this `EvalCtxt` to completion, returning
0 commit comments