@@ -411,7 +411,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
411411
412412 ty:: PredicateKind :: ObjectSafe ( trait_def_id) => {
413413 if !self . selcx . tcx ( ) . check_is_object_safe ( trait_def_id) {
414- ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError ( Unimplemented ) )
414+ ProcessResult :: Error ( FulfillmentErrorCode :: Select ( Unimplemented ) )
415415 } else {
416416 ProcessResult :: Changed ( vec ! [ ] )
417417 }
@@ -435,7 +435,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
435435 ty,
436436 ) {
437437 Ok ( inf_ok) => ProcessResult :: Changed ( mk_pending ( inf_ok. into_obligations ( ) ) ) ,
438- Err ( _) => ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError (
438+ Err ( _) => ProcessResult :: Error ( FulfillmentErrorCode :: Select (
439439 SelectionError :: Unimplemented ,
440440 ) ) ,
441441 }
@@ -493,10 +493,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
493493 Ok ( Err ( err) ) => {
494494 let expected_found =
495495 ExpectedFound :: new ( subtype. a_is_expected , subtype. a , subtype. b ) ;
496- ProcessResult :: Error ( FulfillmentErrorCode :: SubtypeError (
497- expected_found,
498- err,
499- ) )
496+ ProcessResult :: Error ( FulfillmentErrorCode :: Subtype ( expected_found, err) )
500497 }
501498 }
502499 }
@@ -516,10 +513,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
516513 Ok ( Ok ( ok) ) => ProcessResult :: Changed ( mk_pending ( ok. obligations ) ) ,
517514 Ok ( Err ( err) ) => {
518515 let expected_found = ExpectedFound :: new ( false , coerce. a , coerce. b ) ;
519- ProcessResult :: Error ( FulfillmentErrorCode :: SubtypeError (
520- expected_found,
521- err,
522- ) )
516+ ProcessResult :: Error ( FulfillmentErrorCode :: Subtype ( expected_found, err) )
523517 }
524518 }
525519 }
@@ -542,7 +536,7 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
542536 Err (
543537 e @ NotConstEvaluatable :: MentionsParam
544538 | e @ NotConstEvaluatable :: Error ( _) ,
545- ) => ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError (
539+ ) => ProcessResult :: Error ( FulfillmentErrorCode :: Select (
546540 SelectionError :: NotConstEvaluatable ( e) ,
547541 ) ) ,
548542 }
@@ -638,29 +632,27 @@ impl<'a, 'tcx> ObligationProcessor for FulfillProcessor<'a, 'tcx> {
638632 ProcessResult :: Changed ( mk_pending ( inf_ok. into_obligations ( ) ) )
639633 }
640634 Err ( err) => {
641- ProcessResult :: Error ( FulfillmentErrorCode :: ConstEquateError (
635+ ProcessResult :: Error ( FulfillmentErrorCode :: ConstEquate (
642636 ExpectedFound :: new ( true , c1, c2) ,
643637 err,
644638 ) )
645639 }
646640 }
647641 }
648642 ( Err ( ErrorHandled :: Reported ( reported, _) ) , _)
649- | ( _, Err ( ErrorHandled :: Reported ( reported, _) ) ) => {
650- ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError (
651- SelectionError :: NotConstEvaluatable ( NotConstEvaluatable :: Error (
652- reported. into ( ) ,
653- ) ) ,
654- ) )
655- }
643+ | ( _, Err ( ErrorHandled :: Reported ( reported, _) ) ) => ProcessResult :: Error (
644+ FulfillmentErrorCode :: Select ( SelectionError :: NotConstEvaluatable (
645+ NotConstEvaluatable :: Error ( reported. into ( ) ) ,
646+ ) ) ,
647+ ) ,
656648 ( Err ( ErrorHandled :: TooGeneric ( _) ) , _)
657649 | ( _, Err ( ErrorHandled :: TooGeneric ( _) ) ) => {
658650 if c1. has_non_region_infer ( ) || c2. has_non_region_infer ( ) {
659651 ProcessResult :: Unchanged
660652 } else {
661653 // Two different constants using generic parameters ~> error.
662654 let expected_found = ExpectedFound :: new ( true , c1, c2) ;
663- ProcessResult :: Error ( FulfillmentErrorCode :: ConstEquateError (
655+ ProcessResult :: Error ( FulfillmentErrorCode :: ConstEquate (
664656 expected_found,
665657 TypeError :: ConstMismatch ( expected_found) ,
666658 ) )
@@ -741,7 +733,7 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> {
741733 Err ( selection_err) => {
742734 debug ! ( "selecting trait at depth {} yielded Err" , obligation. recursion_depth) ;
743735
744- ProcessResult :: Error ( FulfillmentErrorCode :: SelectionError ( selection_err) )
736+ ProcessResult :: Error ( FulfillmentErrorCode :: Select ( selection_err) )
745737 }
746738 }
747739 }
@@ -793,7 +785,7 @@ impl<'a, 'tcx> FulfillProcessor<'a, 'tcx> {
793785 project_obligation. with( tcx, project_obligation. predicate) ,
794786 ] ) ) ,
795787 ProjectAndUnifyResult :: MismatchedProjectionTypes ( e) => {
796- ProcessResult :: Error ( FulfillmentErrorCode :: ProjectionError ( e) )
788+ ProcessResult :: Error ( FulfillmentErrorCode :: Project ( e) )
797789 }
798790 }
799791 }
0 commit comments